About

IRepository just defines a simple interface with common repository methods and a typed argument.

namespace System.Data.Repository
{
    interface IRepository<T>
     where T : class
    {
        long Delete(IEnumerable<T> objects);
        bool Delete(T oneObject);
        bool DeleteAll();
        bool DeleteById(object id);
        bool Exists(Expression<Func<T, bool>> predicate);
        T GetById(object id);
        T GetSingle(Expression<Func<T, bool>> predicate);
        IEnumerable<T> Insert(IEnumerable<T> objects);
        bool Insert(T oneObject);
        IEnumerable<T> InsertOrUpdate(IEnumerable<T> objects);
        bool InsertOrUpdate(T oneObject);
        IEnumerable<T> Select();
        IEnumerable<T> Select(Expression<Func<T, bool>> predicate);
    }
}

Downloads

Download IRepository from CodePlex or install using NuGet. When using NuGet, you may also download the package direct from Visual Studio.

irepository.png



Last edited May 29, 2013 at 12:05 AM by ggondim, version 5