Beispiel #1
0
        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));
        }
Beispiel #2
0
        public Task AddOrder(OrderDto order)
        {
            order.Id = 0;
            var orderEntity = _mapper.Map <Order>(order);

            return(_dbContext.UpsertEntities(new[] { orderEntity }));
        }
Beispiel #3
0
        public async Task <int> AddUser(UserDto user)
        {
            user.Id = -1;
            var userEntity = _mapper.Map <User>(user);
            await _dbContext.UpsertEntities(new[] { userEntity });

            return(userEntity.Id);
        }
Beispiel #4
0
        public Task SaveColors(List <ColorDto> colors)
        {
            var entities = colors.Select(g => _mapper.Map <Color>(g));

            return(_dbContext.UpsertEntities(entities));
        }
Beispiel #5
0
        public Task SaveMetals(List <MetalDto> metals)
        {
            var entities = metals.Select(g => _mapper.Map <Metal>(g));

            return(_dbContext.UpsertEntities(entities));
        }
Beispiel #6
0
        public Task SaveGemSources(List <GemSourceDto> gemSources)
        {
            var entities = gemSources.Select(g => _mapper.Map <GemstoneSource>(g));

            return(_dbContext.UpsertEntities(entities));
        }
Beispiel #7
0
        public Task SaveSkuDescriptions(List <SkuDescriptionDto> skuDescriptions)
        {
            var entities = skuDescriptions.Select(g => _mapper.Map <SkuDescription>(g));

            return(_dbContext.UpsertEntities(entities));
        }