|
6 | 6 | /// Maintains business objects in-memory which have been changed (inserted, updated, or deleted) in a single transaction. |
7 | 7 | /// Once the transaction is completed, the changes will be sent to the database in one single unit of work. |
8 | 8 | /// </summary> |
9 | | - /// <seealso cref="IRepositoryFactory" /> |
10 | 9 | /// <seealso cref="System.IDisposable" /> |
11 | | - public interface IUnitOfWork : IRepositoryFactory, IDisposable |
| 10 | + public interface IUnitOfWork : IDisposable |
12 | 11 | { |
| 12 | + /// <summary> |
| 13 | + /// Creates a new repository for the specified entity type. |
| 14 | + /// </summary> |
| 15 | + /// <typeparam name="TEntity">The type of the entity.</typeparam> |
| 16 | + /// <returns>The new repository.</returns> |
| 17 | + IRepository<TEntity> Create<TEntity>() where TEntity : class; |
| 18 | + |
| 19 | + /// <summary> |
| 20 | + /// Creates a new repository for the specified entity and primary key type. |
| 21 | + /// </summary> |
| 22 | + /// <typeparam name="TEntity">The type of the entity.</typeparam> |
| 23 | + /// <typeparam name="TKey">The type of the key primary key value.</typeparam> |
| 24 | + /// <returns>The new repository.</returns> |
| 25 | + IRepository<TEntity, TKey> Create<TEntity, TKey>() where TEntity : class; |
| 26 | + |
| 27 | + /// <summary> |
| 28 | + /// Creates a new repository for the specified entity and a composite primary key type. |
| 29 | + /// </summary> |
| 30 | + /// <typeparam name="TEntity">The type of the entity.</typeparam> |
| 31 | + /// <typeparam name="TKey1">The type of the first part of the composite primary key.</typeparam> |
| 32 | + /// <typeparam name="TKey2">The type of the second part of the composite primary key.</typeparam> |
| 33 | + /// <returns>The new repository.</returns> |
| 34 | + IRepository<TEntity, TKey1, TKey2> Create<TEntity, TKey1, TKey2>() where TEntity : class; |
| 35 | + |
| 36 | + /// <summary> |
| 37 | + /// Creates a new repository for the specified entity and a composite primary key type. |
| 38 | + /// </summary> |
| 39 | + /// <typeparam name="TEntity">The type of the entity.</typeparam> |
| 40 | + /// <typeparam name="TKey1">The type of the first part of the composite primary key.</typeparam> |
| 41 | + /// <typeparam name="TKey2">The type of the second part of the composite primary key.</typeparam> |
| 42 | + /// <typeparam name="TKey3">The type of the third part of the composite primary key.</typeparam> |
| 43 | + /// <returns>The new repository.</returns> |
| 44 | + IRepository<TEntity, TKey1, TKey2, TKey3> Create<TEntity, TKey1, TKey2, TKey3>() where TEntity : class; |
| 45 | + |
| 46 | + /// <summary> |
| 47 | + /// Creates a new repository for the specified type. |
| 48 | + /// </summary> |
| 49 | + /// <returns>The new repository.</returns> |
| 50 | + T CreateInstance<T>() where T : class; |
| 51 | + |
13 | 52 | /// <summary> |
14 | 53 | /// Commits all changes made in this unit of work. |
15 | 54 | /// </summary> |
|
0 commit comments