public async Task<IIndexResponse> UpdateAsync(UserDto userDto)
 {
     // Adds an analayzer to the name property in FermentableDto object.
     await _client.MapAsync<UserDto>(d => d.Properties(p => p.String(s => s.Name(n => n.Username).Analyzer("autocomplete"))));
     return await _client.IndexAsync<UserDto>(userDto);
 }
 private async Task ReIndexUserRelationElasticSearch(UserDto userDto)
 {
     foreach (var breweryDto in userDto.Breweries)
     {
         var brewery = breweryDto;
         var result = await _breweryRepository.GetSingleAsync(brewery.Id, "Members.Member", "Origin", "Beers", "Socials", "Beers.Beer.IBU", "Beers.Beer.ABV", "Beers.Beer.SRM", "Beers.Beer.BeerStyle");
         var mappedResult = Mapper.Map<Brewery, BreweryDto>(result);
         await _breweryElasticsearch.UpdateAsync(mappedResult);
     }
 }
 public BlobStorageMultipartStreamProvider(UserDto userDto)
 {
     _userDto = userDto;
 }
 public async Task UpdateAsync(UserDto userDto)
 {
     var user = Mapper.Map<UserDto, User>(userDto);
     await _userRepository.UpdateAsync(user);
     var result = await _userRepository.GetSingleAsync(userDto.Username, _userInclude);
     var mappedResult = Mapper.Map<User, UserDto>(result);
     await _userElasticsearch.UpdateAsync(mappedResult);
     if (mappedResult.Breweries.Any())
         await ReIndexUserRelationElasticSearch(mappedResult);
 }