/// <summary> /// 获取自定义仓储 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="commandSet"></param> /// <returns></returns> public static IBaseRepository <T> GetRepository <T>(this CommandSet <T> commandSet) { //从基础querySet对象中取出连接对象和提供方 var options = new RepositoryOptionsBuilder(); options.BuildConnection(x => commandSet.DbCon); options.BuildProvider(commandSet.SqlProvider); //设置给通用仓储 var baseRepository = new BaseRepositoryExtension <T>(options); return(baseRepository); }
public override void OnConfiguring(RepositoryOptionsBuilder builder) { //通用仓储不实现此方法(交给后续直接添加) }
public BaseRepositoryExtension(RepositoryOptionsBuilder options) : base(options) { }