public virtual async Task UpdateAsync(TblProductDiscountsForUserGroups record) { var oldRecord = await FindByIdAsync(record.Id); _dbContext.ProductDiscountsForUserGroups.AddOrUpdate(record); await _dbContext.SaveChangesAsync(); QueryCacheManager.ExpireTag(CacheTags.ProductDiscountForUserGroup); _eventPublisher.EntityUpdated(record, oldRecord); }
public virtual async Task <int> AddAsync(TblProductDiscountsForUserGroups record) { _dbContext.ProductDiscountsForUserGroups.Add(record); await _dbContext.SaveChangesAsync(); QueryCacheManager.ExpireTag(CacheTags.ProductDiscountForUserGroup); _eventPublisher.EntityInserted(record); return(record.Id); }
public virtual ProductDiscountsForUserGroupsModel PrepareProductDiscountsForUserGroupsModel(TblProductDiscountsForUserGroups record, int productId) { var result = record == null ? new ProductDiscountsForUserGroupsModel() : record.Adapt <ProductDiscountsForUserGroupsModel>(); result.ProductId = productId; return(result); }