private async Task ToQueueElasticUpdate(Category category) { UpdateCategoriesInfoCommand categoryUpdateOrCreate = new UpdateCategoriesInfoCommand { Id = category.Id, Name = category.Name, CountNews = NewsCountByCategory(category.Id) }; await _senderToElastic.UpdateElasticCategories(categoryUpdateOrCreate); }
private async Task ToQueueElasticUpdate(int id) { Category temp = await _database.CategoryRepository.GetById(id); UpdateCategoriesInfoCommand categoryUpdateOrCreate = new UpdateCategoriesInfoCommand { Id = id, Name = temp.Name, CountNews = temp.News.Count }; await _senderToElastic.UpdateElasticCategories(categoryUpdateOrCreate); }