摘要:
很多人使用ORM层都是针对每个数据库表建立相应的类,导致工作量很大,代码重复很多。下面给大家介绍使用linq to entity封装一个公用的ORM类。首先声明一个接口:using System;using System.Collections.Generic;namespace Demode.Repository{ public interface IDBRepository<TEntity> : IDisposable where TEntity : class { System.Data.Objects.ObjectSet<TEntity> DataSo... 阅读全文