|
1 | | -using System; |
2 | | -using System.Data.Entity; |
3 | | -using SharpRepository.Repository.Caching; |
4 | | - |
5 | | -namespace SharpRepository.Ef5Repository |
6 | | -{ |
7 | | - /// <summary> |
8 | | - /// Entity Framework repository layer |
9 | | - /// </summary> |
10 | | - /// <typeparam name="T">The Entity type</typeparam> |
11 | | - /// <typeparam name="TKey">The type of the primary key.</typeparam> |
12 | | - public class Ef5Repository<T, TKey> : Ef5RepositoryBase<T, TKey> where T : class, new() |
13 | | - { |
14 | | - /// <summary> |
15 | | - /// Initializes a new instance of the <see cref="Ef5Repository<T, TKey>"/> class. |
16 | | - /// </summary> |
17 | | - /// <param name="dbContext">The Entity Framework DbContext.</param> |
18 | | - /// <param name="cachingStrategy">The caching strategy to use. Defaults to <see cref="NoCachingStrategy<T, TKey>" /></param> |
19 | | - public Ef5Repository(DbContext dbContext, ICachingStrategy<T, TKey> cachingStrategy = null) : base(dbContext, cachingStrategy) |
20 | | - { |
21 | | - if (dbContext == null) throw new ArgumentNullException("dbContext"); |
22 | | - } |
23 | | - } |
24 | | - |
25 | | - /// <summary> |
26 | | - /// Entity Framework repository layer |
27 | | - /// </summary> |
28 | | - /// <typeparam name="T">The Entity type</typeparam> |
29 | | - public class Ef5Repository<T> : Ef5RepositoryBase<T, int> where T : class, new() |
30 | | - { |
31 | | - /// <summary> |
32 | | - /// Initializes a new instance of the <see cref="Ef5Repository<T>"/> class. |
33 | | - /// </summary> |
34 | | - /// <param name="dbContext">The Entity Framework DbContext.</param> |
35 | | - /// <param name="cachingStrategy">The caching strategy to use. Defaults to <see cref="NoCachingStrategy<T, TKey>" /></param> |
36 | | - public Ef5Repository(DbContext dbContext, ICachingStrategy<T, int> cachingStrategy = null) : base(dbContext, cachingStrategy) |
37 | | - { |
38 | | - if (dbContext == null) throw new ArgumentNullException("dbContext"); |
39 | | - } |
40 | | - } |
41 | | -} |
| 1 | +using System; |
| 2 | +using System.Data.Entity; |
| 3 | +using SharpRepository.Repository; |
| 4 | +using SharpRepository.Repository.Caching; |
| 5 | + |
| 6 | +namespace SharpRepository.Ef5Repository |
| 7 | +{ |
| 8 | + /// <summary> |
| 9 | + /// Entity Framework repository layer |
| 10 | + /// </summary> |
| 11 | + /// <typeparam name="T">The Entity type</typeparam> |
| 12 | + /// <typeparam name="TKey">The type of the primary key.</typeparam> |
| 13 | + public class Ef5Repository<T, TKey> : Ef5RepositoryBase<T, TKey> where T : class, new() |
| 14 | + { |
| 15 | + /// <summary> |
| 16 | + /// Initializes a new instance of the <see cref="Ef5Repository<T, TKey>"/> class. |
| 17 | + /// </summary> |
| 18 | + /// <param name="dbContext">The Entity Framework DbContext.</param> |
| 19 | + /// <param name="cachingStrategy">The caching strategy to use. Defaults to <see cref="NoCachingStrategy<T, TKey>" /></param> |
| 20 | + public Ef5Repository(DbContext dbContext, ICachingStrategy<T, TKey> cachingStrategy = null) : base(dbContext, cachingStrategy) |
| 21 | + { |
| 22 | + if (dbContext == null) throw new ArgumentNullException("dbContext"); |
| 23 | + } |
| 24 | + } |
| 25 | + |
| 26 | + /// <summary> |
| 27 | + /// Entity Framework repository layer |
| 28 | + /// </summary> |
| 29 | + /// <typeparam name="T">The Entity type</typeparam> |
| 30 | + public class Ef5Repository<T> : Ef5RepositoryBase<T, int>, IRepository<T> where T : class, new() |
| 31 | + { |
| 32 | + /// <summary> |
| 33 | + /// Initializes a new instance of the <see cref="Ef5Repository<T>"/> class. |
| 34 | + /// </summary> |
| 35 | + /// <param name="dbContext">The Entity Framework DbContext.</param> |
| 36 | + /// <param name="cachingStrategy">The caching strategy to use. Defaults to <see cref="NoCachingStrategy<T, TKey>" /></param> |
| 37 | + public Ef5Repository(DbContext dbContext, ICachingStrategy<T, int> cachingStrategy = null) : base(dbContext, cachingStrategy) |
| 38 | + { |
| 39 | + if (dbContext == null) throw new ArgumentNullException("dbContext"); |
| 40 | + } |
| 41 | + } |
| 42 | +} |
0 commit comments