mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	- 修复 多表 ToList 非 a,b,c 别名相同实体 bug;#1830 #1861
This commit is contained in:
		@@ -0,0 +1,31 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Linq.Expressions;
 | 
			
		||||
 | 
			
		||||
namespace FreeSql
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    public interface IRepositoryUnitOfWork : IUnitOfWork
 | 
			
		||||
    {
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 在工作单元内创建联合主键的仓储类,工作单元下的仓储操作具有事务特点
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <typeparam name="TEntity"></typeparam>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        IBaseRepository<TEntity> GetRepository<TEntity>() where TEntity : class;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    class RepositoryUnitOfWork : UnitOfWork, IRepositoryUnitOfWork
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        public RepositoryUnitOfWork(IFreeSql fsql) : base(fsql)
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public IBaseRepository<TEntity> GetRepository<TEntity>() where TEntity : class
 | 
			
		||||
        {
 | 
			
		||||
            var repo = new DefaultRepository<TEntity, int>(_fsql);
 | 
			
		||||
            repo.UnitOfWork = this;
 | 
			
		||||
            return repo;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user