-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathConfigRepositoryFactory.cs
More file actions
28 lines (25 loc) · 1.35 KB
/
Copy pathConfigRepositoryFactory.cs
File metadata and controls
28 lines (25 loc) · 1.35 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
namespace SharpRepository.Repository.Configuration
{
public interface IConfigRepositoryFactory
{
IRepository<T> GetInstance<T>() where T : class, new();
IRepository<T, TKey> GetInstance<T, TKey>() where T : class, new();
ICompoundKeyRepository<T, TKey, TKey2> GetInstance<T, TKey, TKey2>() where T : class, new();
ICompoundKeyRepository<T, TKey, TKey2, TKey3> GetInstance<T, TKey, TKey2, TKey3>() where T : class, new();
ICompoundKeyRepository<T> GetCompoundKeyInstance<T>() where T : class, new();
}
public abstract class ConfigRepositoryFactory : IConfigRepositoryFactory
{
protected IRepositoryConfiguration RepositoryConfiguration;
protected ConfigRepositoryFactory(IRepositoryConfiguration config)
{
RepositoryConfiguration = config;
}
public abstract IRepository<T> GetInstance<T>() where T : class, new();
public abstract IRepository<T, TKey> GetInstance<T, TKey>() where T : class, new();
public abstract ICompoundKeyRepository<T, TKey, TKey2> GetInstance<T, TKey, TKey2>() where T : class, new();
public abstract ICompoundKeyRepository<T, TKey, TKey2, TKey3> GetInstance<T, TKey, TKey2, TKey3>() where T : class, new();
public abstract ICompoundKeyRepository<T> GetCompoundKeyInstance<T>() where T : class, new();
}
}