Show / Hide Table of Contents

Class Entity

Provides a base class for an entity.

Inheritance
Object
Entity
AggregateRoot
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Object.MemberwiseClone()
Namespace: IRM.Domain
Assembly: IRM.dll
Syntax
public abstract class Entity : IEntity, IHierarchicalEntity, IEquatable<Entity>, IImplicitRemoveSupport

Constructors

Entity()

Initializes a new instance of the Entity class.

Declaration
protected 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
IEntity.Id

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
IEntity.SenastÄndrad

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
IEntity.SenastÄndradAv

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
IEntity.Skapad

SkapadAv

Gets or sets the user that created this entity.

Declaration
[Required]
[StringLength(121)]
public virtual string SkapadAv { get; set; }
Property Value
String

Implements
IEntity.SkapadAv

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 other is the same entity as this one; otherwise false.

Implements
IEquatable<T>.Equals(T)

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 obj is the same entity as this one; otherwise false.

Overrides
Object.Equals(Object)

GetHashCode()

Returns the hash code for this instance.

Declaration
public override int GetHashCode()
Returns
System.Int32

The hash code for this instance.

Overrides
System.Object.GetHashCode()

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
IEntity.SetSomÄndrad(DateTime, String)

IHierarchicalEntity.AggregateRoot

Declaration
IAggregateRoot IHierarchicalEntity.AggregateRoot { get; set; }
Returns
IAggregateRoot

Implements
IHierarchicalEntity.AggregateRoot

IImplicitRemoveSupport.IsRemoved

Declaration
bool IImplicitRemoveSupport.IsRemoved { get; set; }
Returns
Boolean

Implements
IImplicitRemoveSupport.IsRemoved

Extension Methods

ObjectExtensions.DeepClone<T>(T)
AnnotationsExtensions.IsValid(Object)
Back to top Generated by DocFX