Class DomainObjectBase
A base class for all domain objects.
Inheritance
Inherited Members
Namespace: Nevatech.Vsb.Repository.Entities
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public abstract class DomainObjectBase : IValidator, IExtensibleDataObject
Constructors
DomainObjectBase()
Initializes a new instance of the domain object.
Declaration
protected DomainObjectBase()
DomainObjectBase(DomainObjectBase)
Initializes a new instance and populate it from provided entity.
Declaration
protected DomainObjectBase(DomainObjectBase entity)
Parameters
Type | Name | Description |
---|---|---|
DomainObjectBase | entity | Entity to be initialized (cloned) from. |
Properties
Created
Gets this object's created date and time.
Declaration
public DateTime Created { get; }
Property Value
Type | Description |
---|---|
DateTime |
ErrorMessage
Gets the summary of validation errors populated by the call to Validate() method.
Declaration
public string ErrorMessage { get; protected set; }
Property Value
Type | Description |
---|---|
String |
ExtensionData
Gets or sets ExtensionDataObject that enables serialization roundtrips.
Declaration
public ExtensionDataObject ExtensionData { get; set; }
Property Value
Type | Description |
---|---|
ExtensionDataObject |
Id
Gets or sets this domain object's id.
Declaration
public int Id { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
IsMajorObject
Gets the flag indicating that current object is a major entity.
Declaration
public virtual bool IsMajorObject { get; }
Property Value
Type | Description |
---|---|
Boolean |
Key
Gets or sets the unique identifier of the object.
Declaration
public Guid Key { get; set; }
Property Value
Type | Description |
---|---|
Guid |
ObjectType
Gets object type identifier.
Declaration
public abstract EntityType ObjectType { get; }
Property Value
Type | Description |
---|---|
EntityType |
Updated
Gets this object's updated date and time.
Declaration
public DateTime? Updated { get; }
Property Value
Type | Description |
---|---|
Nullable<DateTime> |
Methods
AreEqual(Nullable<DateTime>, Nullable<DateTime>)
Checks, if provided date/times are equal without checking milliseconds.
Declaration
protected static bool AreEqual(DateTime? dateTime1, DateTime? dateTime2)
Parameters
Type | Name | Description |
---|---|---|
Nullable<DateTime> | dateTime1 | First date/time to compare. |
Nullable<DateTime> | dateTime2 | Second date/time to compare. |
Returns
Type | Description |
---|---|
Boolean | True if provided date/times are equal. False, otherwise. |
Equals(DomainObjectBase)
Determines whether the specified domain object is equal to the current object.
Declaration
protected bool Equals(DomainObjectBase other)
Parameters
Type | Name | Description |
---|---|---|
DomainObjectBase | other | The object to compare with the current object. |
Returns
Type | Description |
---|---|
Boolean | True, if objects are equal. False, if objects are not equal. |
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
Boolean | True, if objects are equal. False, if objects are not equal. |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | Hash code of the current instance. |
Overrides
IsValidElementName(String)
Checks, if provided value conforms to the requirements for a service metadata element name.
Declaration
protected static bool IsValidElementName(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Value that has to be validated. |
Returns
Type | Description |
---|---|
Boolean | True, if provided value conforms to the requirements for a service metadata element name. False, otherwise. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string that represents the current object. |
Overrides
Validate()
Validates this domain object's state.
Declaration
public virtual bool Validate()
Returns
Type | Description |
---|---|
Boolean | True if object's state is valid; otherwise, false. |