Mineplex2018-withcommit/Website/LOC.Core/Data/IRepository.cs

26 lines
946 B
C#
Raw Normal View History

2013-08-27 17:14:08 +02:00
namespace LOC.Core.Data
{
using System;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
public interface IRepository : IDisposable
{
TEntity Add<TEntity>(TEntity entity) where TEntity : class;
bool Any<TEntity>(Expression<Func<TEntity, bool>> predicate) where TEntity : class;
bool Any<TEntity>() where TEntity : class;
void CommitChanges();
void Delete<TEntity>(TEntity entity) where TEntity : class;
void Edit<TEntity>(TEntity entity) where TEntity : class;
void Attach<TEntity>(TEntity entity) where TEntity : class;
IQueryable<TEntity> GetAll<TEntity>() where TEntity : class;
TEntity GetByKeyValues<TEntity>(params object[] keyValues) where TEntity : class;
IQueryable<TEntity> Where<TEntity>(Expression<Func<TEntity, bool>> predicate) where TEntity : class;
DbContext Context { get; }
}
}