- 优化 DbContext/Repository 局部调整;

This commit is contained in:
28810
2019-08-13 19:13:48 +08:00
parent 79ab3ae217
commit a79ee52b4f
14 changed files with 211 additions and 197 deletions

View File

@ -42,23 +42,23 @@ namespace FreeSql
public GuidRepository<TEntity> GetGuidRepository<TEntity>(Expression<Func<TEntity, bool>> filter = null, Func<string, string> asTable = null) where TEntity : class
{
var repos = new GuidRepository<TEntity>(_fsql, filter, asTable);
repos.UnitOfWork = this;
return repos;
var repo = new GuidRepository<TEntity>(_fsql, filter, asTable);
repo.UnitOfWork = this;
return repo;
}
public DefaultRepository<TEntity, TKey> GetRepository<TEntity, TKey>(Expression<Func<TEntity, bool>> filter = null) where TEntity : class
{
var repos = new DefaultRepository<TEntity, TKey>(_fsql, filter);
repos.UnitOfWork = this;
return repos;
var repo = new DefaultRepository<TEntity, TKey>(_fsql, filter);
repo.UnitOfWork = this;
return repo;
}
public BaseRepository<TEntity> GetRepository<TEntity>(Expression<Func<TEntity, bool>> filter = null) where TEntity : class
{
var repos = new DefaultRepository<TEntity, int>(_fsql, filter);
repos.UnitOfWork = this;
return repos;
var repo = new DefaultRepository<TEntity, int>(_fsql, filter);
repo.UnitOfWork = this;
return repo;
}
}
}