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 : using Cqrs.DataStores;
13 : using Cqrs.Entities;
14 : using MongoDB.Bson.Serialization.Attributes;
15 :
16 : namespace Cqrs.Mongo.Entities
17 : {
18 : /// <summary>
19 : /// A projection/entity especially designed to work with MongoDB.
20 : /// </summary>
21 : [Serializable]
22 : [DataContract]
23 : public abstract class MongoEntity : Entity
24 1 : {
25 : /// <summary>
26 : /// The identifier of the <see cref="IEntity"/>.
27 : /// </summary>
28 : [Required]
29 : [BsonId]
30 : [DataMember]
31 : public override Guid Rsn { get; set; }
32 :
33 : /// <summary>
34 : /// The order of this <see cref="IEntity"/> to sort by, by default.
35 : /// </summary>
36 : [DataMember]
37 : public override int SortingOrder { get; set; }
38 :
39 : /// <summary>
40 : /// Indicates if this <see cref="IEntity"/> has been deleted, but not removed from the <see cref="IDataStore{TData}"/>,
41 : /// this way entities can be retrieved so an un-deleted operation can be triggered.
42 : /// </summary>
43 : [Required]
44 : [DataMember]
45 : public override bool IsLogicallyDeleted { get; set; }
46 : }
47 : }
|