public async Task <bool> ProductAddOrUpdateElasticIndexAsync(ProductElasticIndexDto productElasticIndexDto) { try { await _elasticSearchService.CreateProductIndexAsync <ProductElasticIndexDto, int>(ElasticSearchItemsConst.ProductIndexName); await _elasticSearchService.AddOrUpdateAsync <ProductElasticIndexDto, int>(ElasticSearchItemsConst.ProductIndexName, productElasticIndexDto); return(await Task.FromResult <bool>(true)); } catch (Exception ex) { return(await Task.FromException <bool>(ex)); } }