When using the getter of this indexer, if the key is not present in
this entity's set of properties, null is returned.
When using the setter of the indexer, setting a null value removes the
property if it is present. To explicitly set a null value, use ForNull().
Key
public Key Key { get; set; }
The entity's key.
An entity must have a key, unless otherwise documented (for example,
an entity in Value.entity_value may have no key).
An entity's kind is its key path's last element's kind,
or null if it has no key.
public MapField<string, Value> Properties { get; }
The entity's properties.
The map's keys are property names.
A property name matching regex __.*__ is reserved.
A reserved property name is forbidden in certain documented contexts.
The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
be empty.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis webpage provides documentation for the \u003ccode\u003eEntity\u003c/code\u003e class within the Google Cloud Datastore v1 API, specifically for .NET development.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEntity\u003c/code\u003e class represents a Datastore data object and has a maximum size limitation of 1 MiB minus 4 bytes.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation includes a list of available versions of \u003ccode\u003eEntity\u003c/code\u003e, from the latest version 4.15.0 down to version 3.2.0.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eEntity\u003c/code\u003e class include \u003ccode\u003eKey\u003c/code\u003e, which is essential for identifying the entity, and \u003ccode\u003eProperties\u003c/code\u003e, a map of string keys to \u003ccode\u003eValue\u003c/code\u003e objects.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eEntity\u003c/code\u003e class offers methods like \u003ccode\u003eToDelete()\u003c/code\u003e, \u003ccode\u003eToInsert()\u003c/code\u003e, \u003ccode\u003eToUpdate()\u003c/code\u003e, and \u003ccode\u003eToUpsert()\u003c/code\u003e that create \u003ccode\u003eMutation\u003c/code\u003e objects for different data operations, all of which require a pre-existing key.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Datastore v1 API - Class Entity (4.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.15.0 (latest)](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity)\n- [4.14.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.14.0/Google.Cloud.Datastore.V1.Entity)\n- [4.13.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.13.0/Google.Cloud.Datastore.V1.Entity)\n- [4.12.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.12.0/Google.Cloud.Datastore.V1.Entity)\n- [4.11.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.11.0/Google.Cloud.Datastore.V1.Entity)\n- [4.10.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.10.0/Google.Cloud.Datastore.V1.Entity)\n- [4.9.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.9.0/Google.Cloud.Datastore.V1.Entity)\n- [4.8.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.8.0/Google.Cloud.Datastore.V1.Entity)\n- [4.7.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.7.0/Google.Cloud.Datastore.V1.Entity)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.6.0/Google.Cloud.Datastore.V1.Entity)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.5.0/Google.Cloud.Datastore.V1.Entity)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.4.0/Google.Cloud.Datastore.V1.Entity)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.3.0/Google.Cloud.Datastore.V1.Entity)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.2.0/Google.Cloud.Datastore.V1.Entity)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.1.0/Google.Cloud.Datastore.V1.Entity)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.0.0/Google.Cloud.Datastore.V1.Entity)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.5.0/Google.Cloud.Datastore.V1.Entity)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.4.0/Google.Cloud.Datastore.V1.Entity)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.3.0/Google.Cloud.Datastore.V1.Entity)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.2.0/Google.Cloud.Datastore.V1.Entity) \n\n public sealed class Entity : IMessage\u003cEntity\u003e, IEquatable\u003cEntity\u003e, IDeepCloneable\u003cEntity\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Datastore v1 API class Entity.\n\nA Datastore data object.\n\nMust not exceed 1 MiB - 4 bytes. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Entity \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Entity](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Entity](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Entity](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Datastore.V1](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Datastore.V1.dll\n\nConstructors\n------------\n\n### Entity()\n\n public Entity()\n\n### Entity(Entity)\n\n public Entity(Entity other)\n\nProperties\n----------\n\n### this\\[string\\]\n\n public Value this[string name] { get; set; }\n\nIndexer presenting a null-friendly view of the entity properties.\n\n**Remarks** \n\nWhen using the getter of this indexer, if the key is not present in\nthis entity's set of properties, `null` is returned.\n\n\nWhen using the setter of the indexer, setting a null value removes the\nproperty if it is present. To explicitly set a null value, use [ForNull()](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Value#Google_Cloud_Datastore_V1_Value_ForNull).\n\n### Key\n\n public Key Key { get; set; }\n\nThe entity's key.\n\nAn entity must have a key, unless otherwise documented (for example,\nan entity in `Value.entity_value` may have no key).\nAn entity's kind is its key path's last element's kind,\nor null if it has no key.\n\n### Properties\n\n public MapField\u003cstring, Value\u003e Properties { get; }\n\nThe entity's properties.\nThe map's keys are property names.\nA property name matching regex `__.*__` is reserved.\nA reserved property name is forbidden in certain documented contexts.\nThe map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot\nbe empty.\n\nMethods\n-------\n\n### ToDelete()\n\n public Mutation ToDelete()\n\nCreates a mutation representating a delete of this entity, via its [Key](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Entity#Google_Cloud_Datastore_V1_Entity_Key) property.\n\n### ToInsert()\n\n public Mutation ToInsert()\n\nCreates a mutation representating an insert of this entity.\n\n### ToUpdate()\n\n public Mutation ToUpdate()\n\nCreates a mutation representating an update of this entity.\n\n### ToUpsert()\n\n public Mutation ToUpsert()\n\nCreates a mutation representating an upsert of this entity."]]