public Task SaveJewelryModel(JewelryModelDto jewelryModel) { var jm = _mapper.Map <JewelryModel>(jewelryModel); var entities = new List <BaseModel> { jm }; if (jm.Id > 0) { entities.AddRange(jm.Configurations); } return(_dbContext.UpsertEntities(entities)); }
public Task AddOrder(OrderDto order) { order.Id = 0; var orderEntity = _mapper.Map <Order>(order); return(_dbContext.UpsertEntities(new[] { orderEntity })); }
public async Task <int> AddUser(UserDto user) { user.Id = -1; var userEntity = _mapper.Map <User>(user); await _dbContext.UpsertEntities(new[] { userEntity }); return(userEntity.Id); }
public Task SaveColors(List <ColorDto> colors) { var entities = colors.Select(g => _mapper.Map <Color>(g)); return(_dbContext.UpsertEntities(entities)); }
public Task SaveMetals(List <MetalDto> metals) { var entities = metals.Select(g => _mapper.Map <Metal>(g)); return(_dbContext.UpsertEntities(entities)); }
public Task SaveGemSources(List <GemSourceDto> gemSources) { var entities = gemSources.Select(g => _mapper.Map <GemstoneSource>(g)); return(_dbContext.UpsertEntities(entities)); }
public Task SaveSkuDescriptions(List <SkuDescriptionDto> skuDescriptions) { var entities = skuDescriptions.Select(g => _mapper.Map <SkuDescription>(g)); return(_dbContext.UpsertEntities(entities)); }