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