【发布时间】:2018-07-16 20:05:57
【问题描述】:
BindAsync函数有什么特点?
我有一个在 get all 后使用此命令的示例方法。
public async Task<Either<Exception, List<Clients>>> BuscarClientes()
{
return await GetAllByAsync(x => true)
.BindAsync(clients =>
{
clients = clients.Where(x => x.active == "S")
.OrderBy(x => x.Name)
return clients
}
}
此方法创建一个规则,该规则返回按名称排序的活动客户端列表。
它从GetAllByAsync 方法返回这个列表:
public virtual async Task<Either<Exception, IEnumerable<TEntity>>> GetAllByAsync(Expression<Func<TEntity, bool>> parameter)
{
try
{
return Right<Exception, Option<TEntity>>(await DBEntity.Where(parameter).ToListAsync());
}
catch
{
return ex;
}
}
谁能告诉我这个BindAsync 方法是干什么用的,它是如何工作的?
【问题讨论】:
标签: c# azure asynchronous bind