Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System;
10 : using System.ComponentModel.DataAnnotations;
11 : using System.Runtime.Serialization;
12 : #if NET40
13 : using System.Data.Linq.Mapping;
14 : #endif
15 : using Cqrs.DataStores;
16 :
17 : namespace Cqrs.Entities
18 : {
19 : /// <summary>
20 : /// A projection/entity.
21 : /// </summary>
22 : [Serializable]
23 : [DataContract]
24 : public abstract class Entity : IEntity
25 1 : {
26 : /// <summary>
27 : /// The identifier of the <see cref="IEntity"/>.
28 : /// </summary>
29 : [Required]
30 : [DataMember]
31 : #if NET40
32 : [Column(IsPrimaryKey = true)]
33 : #endif
34 : public virtual Guid Rsn { get; set; }
35 :
36 : /// <summary>
37 : /// The order of this <see cref="IEntity"/> to sort by, by default.
38 : /// </summary>
39 : [DataMember]
40 : #if NET40
41 : [Column]
42 : #endif
43 : public virtual int SortingOrder { get; set; }
44 :
45 : /// <summary>
46 : /// Indicates if this <see cref="IEntity"/> has been deleted, but not removed from the <see cref="IDataStore{TData}"/>,
47 : /// this way entities can be retrieved so an un-deleted operation can be triggered.
48 : /// </summary>
49 : [Required]
50 : [DataMember]
51 : #if NET40
52 : [Column]
53 : #endif
54 : public virtual bool IsDeleted { get; set; }
55 : }
56 : }
|