EntityFramework用法探索(四)Repository和UnitOfWork

以上一篇CodeFirst生成代碼爲基礎,繼續探索使用方式。 引入Repository模式,定義最簡單的IRepository接口,僅包含增刪改查接口, 1 public interface IRepository<T> 2 where T : class 3 { 4 IQueryable<T> Query(); 5 void Insert(T entity); 6
相關文章
相關標籤/搜索