public virtual async Task UpdateOptionAsync(TblProductCheckoutAttributeOptions record) { var oldRecord = await FindOptionByIdAsync(record.Id); _dbContext.ProductCheckoutAttributeOptions.AddOrUpdate(record); await _dbContext.SaveChangesAsync(); QueryCacheManager.ExpireTag(CacheTags.ProductCheckoutAttribute); _eventPublisher.EntityUpdated(record, oldRecord); }
public virtual async Task <int> AddOptionAsync(TblProductCheckoutAttributeOptions record) { _dbContext.ProductCheckoutAttributeOptions.Add(record); await _dbContext.SaveChangesAsync(); QueryCacheManager.ExpireTag(CacheTags.ProductCheckoutAttribute); _eventPublisher.EntityInserted(record); return(record.Id); }
public virtual async Task <string> GenerateLicenseForProductAttributeOptionAsync(TblInvoices invoice, TblUsers user, TblProductCheckoutAttributeOptions attributeOption, int quantity) { return("Test product checkout attribute option license for : " + attributeOption.GetLocalized(p => p.Name)); }
public virtual async Task <ProductCheckoutAttributeOptionModel> PrepareProductCheckoutAttributeOptionModelAsync(TblProductCheckoutAttributeOptions option, int attributeId) { ProductCheckoutAttributeOptionModel result; if (option == null) { result = new ProductCheckoutAttributeOptionModel(); } else { result = option.Adapt <ProductCheckoutAttributeOptionModel>(); await option.LoadAllLocalizedStringsToModelAsync(result); } result.ProductCheckoutAttributeId = attributeId; return(result); }