Class SingletonEntityInitialiser
Used to specify that an entity should be constructed with a specific ID instead of a random one.
public sealed class SingletonEntityInitialiser : CreatingEntityInitialiser, IEntityInitialiser
- Inheritance
-
SingletonEntityInitialiser
- Implements
- Inherited Members
Examples
var entityID = Guid.Parse("replace this with your known GUID");
var dog = (Dog)Dog.Metadata.ConstructEntity(context, new SingletonEntityInitialiser(entityID));
Remarks
Users must ensure that the specified singletonID is not reused anywhere within the same database.
Constructors
SingletonEntityInitialiser(Guid)
Used to specify that an entity should be constructed with a specific ID instead of a random one.
public SingletonEntityInitialiser(Guid singletonID)
Parameters
singletonIDGuid
Examples
var entityID = Guid.Parse("replace this with your known GUID");
var dog = (Dog)Dog.Metadata.ConstructEntity(context, new SingletonEntityInitialiser(entityID));
Remarks
Users must ensure that the specified singletonID is not reused anywhere within the same database.
Methods
GetExisting<T>(IEntityContext, Exception)
public override T GetExisting<T>(IEntityContext context, Exception triggeringException) where T : IEntity<T>
Parameters
contextIEntityContexttriggeringExceptionException
Returns
- T
Type Parameters
T
LoadAttributes(AttributeBase[])
public override void LoadAttributes(AttributeBase[] attributes)
Parameters
attributesAttributeBase[]