public async Task CreateCatalogItem(ItemForModeration item) { var newCatalogItem = new ProducerCatalogItem { EnName = item.EnName, RuName = item.RuName, ProducerId = item.ProducerId, ProducerCode = item.ProducerCode, ProducerCodeTrimmed = _producerCodeService.TrimCode(item.ProducerCode), SeoParameterId = item.SeoParameterId }; await _dbContext.AddAsync(newCatalogItem); await _dbContext.SaveChangesAsync(); }
public async Task SetForModeration(IEnumerable <int> ids) { this.ResetModerationForAll(); var priceItems = _dbContext.SupplierPriceItems.Where(x => ids.ToArray().Contains(x.ID) && x.Status != PartStatusEnum.OnModeration).ToList(); foreach (var item in priceItems) { item.Status = PartStatusEnum.OnModeration; } _dbContext.SupplierPriceItems.UpdateRange(priceItems); await _dbContext.SaveChangesAsync(); }