Beispiel #1
0
        public async Task <Result <Contracts.Image, Contracts.Error> > ReplaceAsync(string galleryName, string imageId, byte[] data, byte[] meta)
        {
            var result = await Name.FromString(galleryName)
                         .AndThenAsync(name => Id.FromString(imageId)
                                       .AndThenAsync(id => _uploadService.ReplaceAsync(name, id, data, meta?.Length > 0 ? Option.Some(meta) : Option.None())));

            return(result.Map(ToContract, ErrorExtensions.ToContract));
        }