60 lines
1.6 KiB
C#
60 lines
1.6 KiB
C#
using Church.Net.Entity.Interface;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net.NetworkInformation;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Church.Net.DAL.EFCoreDBF
|
|
{
|
|
public interface ICrudDAL<T> where T : class, IEntity
|
|
{
|
|
IQueryable<T> GetDbSet();
|
|
T First(Func<T, bool> filter = null);
|
|
|
|
T GetById(string Id);
|
|
IEnumerable<T> GetAll(Func<T, bool> filter = null);
|
|
//IEnumerable<T> GetAllById(IEnumerable<string> Ids);
|
|
int Create(T entity);
|
|
Task<int> CreateAsync(T entity);
|
|
|
|
int CreateOrUpdate(T entity);
|
|
int Update(T entity);
|
|
void CreateDone(T entity);
|
|
void UpdateDone(T entity);
|
|
|
|
int UpdateRange(IEnumerable<T> entities);
|
|
|
|
int Delete(T obj);
|
|
int Delete(Func<T, bool> filter);
|
|
|
|
bool CheckExist(T obj);
|
|
}
|
|
|
|
|
|
public interface ICombinedKeyCrudDAL<T> where T : class
|
|
{
|
|
IQueryable<T> GetDbSet();
|
|
T First(Func<T, bool> filter = null);
|
|
|
|
T GetById(IEnumerable<string> combinedKeyIds);
|
|
IEnumerable<T> GetAll(Func<T, bool> filter = null);
|
|
int Create(T entity);
|
|
Task<int> CreateAsync(T entity);
|
|
int CreateOrUpdate(T entity);
|
|
int Update(T entity);
|
|
void CreateDone(T entity);
|
|
void UpdateDone(T entity);
|
|
|
|
int UpdateRange(IEnumerable<T> entities);
|
|
|
|
int Delete(T obj);
|
|
int Delete(IEnumerable<string> combinedKeyIds);
|
|
int Delete(Func<T, bool> filter);
|
|
|
|
bool CheckExist(T obj);
|
|
}
|
|
}
|