Created
November 8, 2011 21:05
-
-
Save jpolvora/1349224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace Metavision.Infra.Data | |
{ | |
public interface IUnitOfWork : IDisposable | |
{ | |
T Find<T>(params object[] keyValues) where T : class , new(); | |
/// <summary> | |
/// Deve adicionar um registro ao repositório | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="entity"></param> | |
void Add<T>(T entity) where T : class; | |
/// <summary> | |
/// Deve remover um registro do repositório | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="entity"></param> | |
void Remove<T>(T entity) where T : class; | |
/// <summary> | |
/// Deve retornar um objeto IQueryable do repositório | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <returns></returns> | |
IQueryable<T> Get<T>() where T : class; | |
/// <summary> | |
/// Deve retornar a quantidade de repositórios que estão anexados ao UnitOfWork atual | |
/// </summary> | |
int AttachedRepositories { get; } | |
/// <summary> | |
/// Persiste os dados de todos os repositórios anexados ao UnitOfWork atual | |
/// </summary> | |
/// <returns></returns> | |
int Commit(); | |
/// <summary> | |
/// Deve cancelar todas as operações pendentes | |
/// </summary> | |
void RollBack(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment