mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 优化 .Select<object>().WithSql(sql).ToList<T>() 体验;
This commit is contained in:
@ -371,7 +371,12 @@ namespace FreeSql.Internal.CommonProvider
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
public List<TDto> ToList<TDto>() => typeof(T1) == typeof(TDto) ? ToList() as List<TDto> : ToList(GetToListDtoSelector<TDto>());
|
||||
public List<TDto> ToList<TDto>()
|
||||
{
|
||||
if (typeof(T1) == typeof(TDto)) return ToList() as List<TDto>;
|
||||
if (_tables.FirstOrDefault()?.Table.Type == typeof(object)) return ToList<TDto>("*");
|
||||
return ToList(GetToListDtoSelector<TDto>());
|
||||
}
|
||||
Expression<Func<T1, TDto>> GetToListDtoSelector<TDto>()
|
||||
{
|
||||
var expParam = _tables[0].Parameter ?? Expression.Parameter(typeof(T1), "a");
|
||||
|
Reference in New Issue
Block a user