First Initial
This commit is contained in:
41
EF/_IBaseRepository2.cs
Normal file
41
EF/_IBaseRepository2.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace TTSW.EF
|
||||
{
|
||||
public interface IBaseRepository2<T, Key>
|
||||
where T : class, IBaseEntity2<Key>
|
||||
{
|
||||
#region Property
|
||||
DbSet<T> Entities { get; }
|
||||
DataContext Context { get; }
|
||||
#endregion
|
||||
|
||||
#region Query Functions
|
||||
T Get(Key id);
|
||||
T Get(Key id, params Expression<Func<T, object>>[] includes);
|
||||
IQueryable<T> GetQuery();
|
||||
List<T> GetList(Expression<Func<T, bool>> predicate);
|
||||
List<T> GetList(Expression<Func<T, bool>> predicate, params Expression<Func<T, object>>[] includes);
|
||||
#endregion
|
||||
|
||||
#region Manipulation Functions
|
||||
T Insert(T entity);
|
||||
void Insert(IEnumerable<T> list);
|
||||
T Update(Key id, object model);
|
||||
T SetAsInActive(Key id);
|
||||
T SetAsActive(Key id);
|
||||
void Delete(Key id);
|
||||
void Delete(Expression<Func<T, bool>> predicate);
|
||||
|
||||
void InsertWithoutCommit(T entity);
|
||||
void UpdateWithoutCommit(Key id, object model);
|
||||
void DeleteWithoutCommit(Key id);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user