Код: Выделить всё
public static async Task GetExistingStreamIdAsync(
this Result collection,
Expression filter)
where T : IHasName, IHasVersionId, IHasStreamId
=> await collection.Value.Find(filter).AnyAsync()
? Result.Ok((await collection.Value.Find(filter).FirstAsync()).StreamId)
: Result.Fail($"No document exists for filter = '{filter}'");
Подробнее здесь: https://stackoverflow.com/questions/793 ... in-c-sharp
Мобильная версия