public sealed class Entity : IMessage<Entity>, IEquatable<Entity>, IDeepCloneable<Entity>, IBufferMessage, IMessage
A Datastore data object.
An entity is limited to 1 megabyte when stored. That roughly corresponds to a limit of 1 megabyte for the serialized form of this message.
Namespace
Google.Cloud.Datastore.V1Assembly
Google.Cloud.Datastore.V1.dll
Constructors
Entity()
public Entity()
Entity(Entity)
public Entity(Entity other)
Parameter | |
---|---|
Name | Description |
other | Entity |
Properties
Item[String]
public Value this[string name] { get; set; }
Indexer presenting a null-friendly view of the entity properties.
Parameter | |
---|---|
Name | Description |
name | String Property name to access. The name itself must not be null. |
Property Value | |
---|---|
Type | Description |
Value | The property value associated with the key. |
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.
Property Value | |
---|---|
Type | Description |
Key |
Properties
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 name must not contain more than 500 characters.
The name cannot be ""
.
Property Value | |
---|---|
Type | Description |
MapField<String, Value> |
Methods
ToDelete()
public Mutation ToDelete()
Creates a mutation representating a delete of this entity, via its Key property.
Returns | |
---|---|
Type | Description |
Mutation |
Exceptions | |
---|---|
Type | Description |
InvalidOperationException | The entity does not have a key. |
ToInsert()
public Mutation ToInsert()
Creates a mutation representating an insert of this entity.
Returns | |
---|---|
Type | Description |
Mutation |
Exceptions | |
---|---|
Type | Description |
InvalidOperationException | The entity does not have a key. |
ToUpdate()
public Mutation ToUpdate()
Creates a mutation representating an update of this entity.
Returns | |
---|---|
Type | Description |
Mutation |
Exceptions | |
---|---|
Type | Description |
InvalidOperationException | The entity does not have a key. |
ToUpsert()
public Mutation ToUpsert()
Creates a mutation representating an upsert of this entity.
Returns | |
---|---|
Type | Description |
Mutation |
Exceptions | |
---|---|
Type | Description |
InvalidOperationException | The entity does not have a key. |