-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathInMemoryRepository.cs
More file actions
45 lines (40 loc) · 1.64 KB
/
Copy pathInMemoryRepository.cs
File metadata and controls
45 lines (40 loc) · 1.64 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
using SharpRepository.Repository;
using SharpRepository.Repository.Caching;
namespace SharpRepository.InMemoryRepository
{
public class InMemoryRepository<T, TKey> : InMemoryRepositoryBase<T, TKey> where T : class, new()
{
public InMemoryRepository(ICachingStrategy<T, TKey> cachingStrategy = null) : base(cachingStrategy)
{
}
}
// The IRepository<T> is needed here and not on the one above in order to allow programming against IRepository<T> when using an int as the PK
public class InMemoryRepository<T> : InMemoryRepositoryBase<T, int>, IRepository<T> where T : class, new()
{
public InMemoryRepository(ICachingStrategy<T, int> cachingStrategy = null)
: base(cachingStrategy)
{
}
}
public class InMemoryCompoundKeyRepository<T> : InMemoryCompoundKeyRepositoryBase<T> where T : class, new()
{
public InMemoryCompoundKeyRepository(ICompoundKeyCachingStrategy<T> cachingStrategy = null)
: base(cachingStrategy)
{
}
}
public class InMemoryRepository<T, TKey, TKey2> : InMemoryCompoundKeyRepositoryBase<T, TKey, TKey2> where T : class, new()
{
public InMemoryRepository(ICompoundKeyCachingStrategy<T, TKey, TKey2> cachingStrategy = null)
: base(cachingStrategy)
{
}
}
public class InMemoryRepository<T, TKey, TKey2, TKey3> : InMemoryCompoundKeyRepositoryBase<T, TKey, TKey2, TKey3> where T : class, new()
{
public InMemoryRepository(ICompoundKeyCachingStrategy<T, TKey, TKey2, TKey3> cachingStrategy = null)
: base(cachingStrategy)
{
}
}
}