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.Linq.Expressions;
11 : using Cqrs.Entities;
12 : using Cqrs.Mongo.Entities;
13 :
14 : namespace Cqrs.Mongo.DataStores.Indexes
15 : {
16 : /// <summary>
17 : /// A <see cref="MongoIndex{TEntity}"/> for <see cref="IEntity.IsLogicallyDeleted"/> and <see cref="IEntity.Rsn"/>
18 : /// </summary>
19 : /// <typeparam name="TEntity">The <see cref="Type"/> of <see cref="IEntity"/> this index is for.</typeparam>
20 : public abstract class ByIsLogicallyDeletedAndRsnMongoIndex<TEntity> : MongoIndex<TEntity>
21 : where TEntity : MongoEntity
22 1 : {
23 : /// <summary>
24 : /// Instantiate a new instance of <see cref="ByIsLogicallyDeletedAndRsnMongoIndex{TEntity}"/>.
25 : /// </summary>
26 1 : protected ByIsLogicallyDeletedAndRsnMongoIndex()
27 : {
28 : Selectors = new Expression<Func<TEntity, object>>[]
29 : {
30 : entity => entity.IsLogicallyDeleted,
31 : entity => entity.Rsn
32 : };
33 :
34 : IsUnique = true;
35 : }
36 : }
37 : }
|