mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-20 04:48:16 +08:00
- 增加 ISelect.First<Dto>() 方法;
This commit is contained in:
@ -372,16 +372,17 @@ namespace FreeSql.Internal.CommonProvider
|
||||
}
|
||||
|
||||
public bool Any(Expression<Func<T1, bool>> exp) => this.Where(exp).Any();
|
||||
|
||||
public Task<bool> AnyAsync(Expression<Func<T1, bool>> exp) => this.Where(exp).AnyAsync();
|
||||
|
||||
public TReturn ToOne<TReturn>(Expression<Func<T1, TReturn>> select) => this.Limit(1).ToList(select).FirstOrDefault();
|
||||
|
||||
async public Task<TReturn> ToOneAsync<TReturn>(Expression<Func<T1, TReturn>> select) => (await this.Limit(1).ToListAsync(select)).FirstOrDefault();
|
||||
public TDto ToOne<TDto>() => this.Limit(1).ToList<TDto>().FirstOrDefault();
|
||||
async public Task<TDto> ToOneAsync<TDto>() => (await this.Limit(1).ToListAsync<TDto>()).FirstOrDefault();
|
||||
|
||||
public TReturn First<TReturn>(Expression<Func<T1, TReturn>> select) => this.ToOne(select);
|
||||
|
||||
public Task<TReturn> FirstAsync<TReturn>(Expression<Func<T1, TReturn>> select) => this.ToOneAsync(select);
|
||||
public TDto First<TDto>() => this.ToOne<TDto>();
|
||||
public Task<TDto> FirstAsync<TDto>() => this.ToOneAsync<TDto>();
|
||||
|
||||
public ISelect<T1> Include<TNavigate>(Expression<Func<T1, TNavigate>> navigateSelector) where TNavigate : class
|
||||
{
|
||||
|
Reference in New Issue
Block a user