예제 #1
0
 public async Task <ApiResponse <FuelingDisplayDto> > Get(string fuelingId) =>
 await GuidParser.ParseGuid(fuelingId)
 .ToResult(Errors.Error($"Provided id was in incorrect format: {fuelingId}"))
 .BindAsync(id => Storage.Get(id))
 .MapAsync(FuelingMapper.MapToFuelingDisplayDto)
 .DoWhenErrorAsync(e => Logger.Warn(e.Message, e.Exception))
 .ToResponseAsync();
예제 #2
0
 public async Task <ApiResponse <Unit> > Delete(string fuelingId) =>
 await GuidParser.ParseGuid(fuelingId)
 .ToResult(Errors.Error($"Provided id was in incorrect format: {fuelingId}"))
 .BindAsync(id => Storage.Delete(id))
 .DoWhenErrorAsync(e => Logger.Warn(e.Message, e.Exception))
 .ToResponseAsync();