コード例 #1
0
 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);
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 public BlobStorageMultipartStreamProvider(UserDto userDto)
 {
     _userDto = userDto;
 }
コード例 #4
0
 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);
 }