Exemplo n.º 1
0
 private async Task <Validation <BaseError, LibraryPath> > MediaSourceMustExist(DeleteLocalLibraryPath request) =>
 (await _libraryRepository.GetPath(request.LocalLibraryPathId))
 .HeadOrNone()
 .ToValidation <BaseError>(
     $"Local library path {request.LocalLibraryPathId} does not exist.");
Exemplo n.º 2
0
 public Task <Either <BaseError, Unit> > Handle(
     DeleteLocalLibraryPath request,
     CancellationToken cancellationToken) =>
 MediaSourceMustExist(request)
 .MapT(DoDeletion)
 .Bind(t => t.ToEitherAsync());