Class Entity
Provides a base class for an entity.
Inherited Members
Namespace: IRM.Domain
Assembly: IRM.dll
Syntax
public abstract class Entity : IEntity, IHierarchicalEntity, IEquatable<Entity>, IImplicitRemoveSupport
Constructors
Entity()
Properties
AggregateRoot
Gets or sets a reference to the aggregate root that this entity belongs too.
Declaration
[IgnoreDataMember]
[NotMapped]
protected virtual IAggregateRoot AggregateRoot { get; set; }
Property Value
IAggregateRoot
|
Remarks
When useing an EntityList<T> for the entities, it will set this value automatically.
Id
Gets or sets the unique identifier for this entity.
Declaration
[Key]
[Column(Order = 1)]
public Guid Id { get; set; }
Property Value
System.Guid
|
Implements
SenastÄndrad
Gets or sets the System.DateTime when this entity changed last time. For newly created entities this will be the same as Skapad.
Declaration
[Required]
public virtual DateTime SenastÄndrad { get; set; }
Property Value
System.DateTime
|
Implements
SenastÄndradAv
Gets or sets the user that changed this entity last time. For newly created entities this will be the same as SkapadAv.
Declaration
[Required]
[StringLength(121)]
public virtual string SenastÄndradAv { get; set; }
Property Value
String
|
Implements
Skapad
Gets or sets the System.DateTime when this entity first was created.
Declaration
[Required]
public virtual DateTime Skapad { get; set; }
Property Value
System.DateTime
|
Implements
SkapadAv
Gets or sets the user that created this entity.
Declaration
[Required]
[StringLength(121)]
public virtual string SkapadAv { get; set; }
Property Value
String
|
Implements
Methods
Equals(Entity)
Returns a value indicating whether this instance and a specified Entity object represent the same value.
Declaration
public bool Equals(Entity other)
Parameters
Entity
other
The Entity to compare with this instance. |
Returns
Boolean
true if |
Implements
Equals(Object)
Returns a value indicating whether this instance and a specified Entity object represent the same value.
Declaration
public override bool Equals(object obj)
Parameters
Object
obj
The Entity to compare with this instance. |
Returns
Boolean
true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System.Int32
The hash code for this instance. |
Overrides
SetSomÄndrad(DateTime, String)
Updates SenastÄndrad to the specified DateTime and SenastÄndradAv to the System.Security.Principal.IIdentity.Name.
Declaration
protected virtual void SetSomÄndrad(DateTime ändrad, string ändradAv = null)
Parameters
System.DateTime
ändrad
The System.DateTime when the entity changed. |
String
ändradAv
The user that caused the entity to change. If null, the current user from the thread will be used. |
Explicit Interface Implementations
IEntity.SetSomÄndrad(DateTime, String)
Declaration
void IEntity.SetSomÄndrad(DateTime ändrad, string ändradAv)
Parameters
System.DateTime
ändrad
|
String
ändradAv
|
Implements
IHierarchicalEntity.AggregateRoot
Declaration
IAggregateRoot IHierarchicalEntity.AggregateRoot { get; set; }
Returns
IAggregateRoot
|