using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PalGain.Core { public interface IRespository where T : BaseEntity { /// /// Get entity by identifier /// /// Identifier /// Entity T GetById(object id); /// /// 执行增删改的SQl /// /// /// int ExecuteSqlCommand(string sql); /// /// Insert entity /// /// Entity void Insert(T entity); /// /// Insert entities /// /// Entities void Insert(IEnumerable entities); /// /// Update entity /// /// Entity void Update(T entity); /// /// Update entities /// /// Entities void Update(IEnumerable entities); /// /// Delete entity /// /// Entity void Delete(T entity); /// /// Delete entities /// /// Entities void Delete(IEnumerable entities); /// /// Gets a table /// IQueryable Table { get; } /// /// Gets a table with "no tracking" enabled (EF feature) Use it only when you load record(s) only for read-only operations /// IQueryable TableNoTracking { get; } } }