-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathCompoundKeyRepositoryQuerySingleContext.cs
More file actions
66 lines (61 loc) · 2.58 KB
/
Copy pathCompoundKeyRepositoryQuerySingleContext.cs
File metadata and controls
66 lines (61 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Linq.Expressions;
using SharpRepository.Repository.Queries;
using SharpRepository.Repository.Specifications;
namespace SharpRepository.Repository.Aspects
{
public class CompoundKeyRepositoryQuerySingleContext<T, TKey, TKey2> : CompoundKeyRepositoryQuerySingleContext<T, TKey, TKey2, T> where T : class
{
public CompoundKeyRepositoryQuerySingleContext(ICompoundKeyRepository<T, TKey, TKey2> repository, ISpecification<T> specification, IQueryOptions<T> queryOptions)
: base(repository, specification, queryOptions)
{
}
}
public class CompoundKeyRepositoryQuerySingleContext<T> : CompoundKeyRepositoryQuerySingleContext<T, T> where T : class
{
public CompoundKeyRepositoryQuerySingleContext(ICompoundKeyRepository<T> repository, ISpecification<T> specification, IQueryOptions<T> queryOptions)
: base(repository, specification, queryOptions)
{
}
}
public class CompoundKeyRepositoryQuerySingleContext<T, TKey, TKey2, TResult> : CompoundKeyRepositoryQueryContext<T, TKey, TKey2, TResult> where T : class
{
public CompoundKeyRepositoryQuerySingleContext(ICompoundKeyRepository<T, TKey, TKey2> repository, ISpecification<T> specification,
IQueryOptions<T> queryOptions, Expression<Func<T, TResult>> selector = null)
: base(repository, specification, queryOptions, selector)
{
}
public TResult Result { get; set; }
public bool HasResult
{
get { return NumberOfResults != 0; }
}
public override int NumberOfResults
{
get
{
return Result == null || Result.Equals(default(TResult)) ? 0 : 1;
}
}
}
public class CompoundKeyRepositoryQuerySingleContext<T, TResult> : CompoundKeyRepositoryQueryContext<T, TResult> where T : class
{
public CompoundKeyRepositoryQuerySingleContext(ICompoundKeyRepository<T> repository, ISpecification<T> specification,
IQueryOptions<T> queryOptions, Expression<Func<T, TResult>> selector = null)
: base(repository, specification, queryOptions, selector)
{
}
public TResult Result { get; set; }
public bool HasResult
{
get { return NumberOfResults != 0; }
}
public override int NumberOfResults
{
get
{
return Result == null || Result.Equals(default(TResult)) ? 0 : 1;
}
}
}
}