Entity Class
Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online
Represents an instance of an entity (a record).
Namespace: Microsoft.Xrm.Sdk
Assembly: Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)
Inheritance Hierarchy
System.Object
Microsoft.Xrm.Sdk.Entity
Syntax
[DataContractAttribute(Name = "Entity", Namespace = "https://schemas.microsoft.com/xrm/2011/Contracts")]
public class Entity : IExtensibleDataObject
<DataContractAttribute(Name := "Entity", Namespace := "https://schemas.microsoft.com/xrm/2011/Contracts")>
Public Class Entity
Implements IExtensibleDataObject
Constructors
Name | Description | |
---|---|---|
Entity() | Initializes a new instance of the Entity class. |
|
Entity(String) | Initializes a new instance of the Entity class setting the entity name. |
|
Entity(String, Guid) | Initializes a new instance of the Entity class. This was introduced with Microsoft Dynamics CRM Online 2015 Update 1 and cannot be used with earlier versions. |
|
Entity(String, KeyAttributeCollection) | Initializes a new instance of the Entity class. This was introduced with Microsoft Dynamics CRM Online 2015 Update 1 and cannot be used with earlier versions. |
|
Entity(String, String, Object) | Initializes a new instance of the Entity class. This was introduced with Microsoft Dynamics CRM Online 2015 Update 1 and cannot be used with earlier versions. |
Properties
Name | Description | |
---|---|---|
Attributes | Gets or sets the collection of attributes for the entity. |
|
EntityState | Gets or sets the state of the entity. |
|
ExtensionData | Gets or sets the structure that contains extra data. |
|
FormattedValues | Gets of sets the collection of formatted values for the entity attributes. |
|
Id | Gets or sets the ID of the record represented by this entity instance. |
|
Item[String] | Provides an indexer for the attribute values. |
|
KeyAttributes | Gets or sets the key attributes. |
|
LogicalName | Gets or sets the logical name of the entity. |
|
RelatedEntities | Gets or sets a collection of entity references (references to records). |
|
RowVersion | Gets or sets the row version |
Methods
Name | Description | |
---|---|---|
Contains(String) | Checks to see if there is a value present for the specified attribute. |
|
Equals(Object) | (Inherited from Object.) |
|
Finalize() | (Inherited from Object.) |
|
GetAttributeValue<T>(String) | Gets the value of the attribute. |
|
GetFormattedAttributeValue(String) | Gets the formatted value of the attribute. |
|
GetHashCode() | (Inherited from Object.) |
|
GetRelatedEntities<TEntity>(String, Nullable<EntityRole>) | Gets the collection of related entity instances for the specified relationship. |
|
GetRelatedEntity<TEntity>(String, Nullable<EntityRole>) | Gets the related entity instance for the specified relationship. |
|
GetType() | (Inherited from Object.) |
|
MemberwiseClone() | (Inherited from Object.) |
|
SetAttributeValue(String, Object) | Sets the value of an attribute. |
|
SetRelatedEntities<TEntity>(String, Nullable<EntityRole>, IEnumerable<TEntity>) | Sets the collection of related entity instances for the specified relationship. |
|
SetRelatedEntity<TEntity>(String, Nullable<EntityRole>, TEntity) | Sets the related entity instance for the specified relationship. |
|
ToEntity<T>() | Gets the entity as the specified type. |
|
ToEntityReference() | Gets an entity reference for this entity instance. |
|
ToString() | (Inherited from Object.) |
Remarks
Entity is the base class for all types of entities in Microsoft Dynamics 365. You use this class for both early and late bound programming.
Thread Safety
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.Xrm.Sdk Namespace
Use the early bound entity classes in code
Use the late bound entity class in code
Return to top
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright