Esempio n. 1
0
        public async Task UpdateProductAsync([FromBody] vm.Product product)
        {
            var entity = await _ds.SelectProductAsync(product.ProductId);

            _mapper.Map(product, entity);
            await _ds.SaveChangesAsync();
        }
Esempio n. 2
0
        public async Task <int> InsertProductAsync([FromBody] vm.Product product)
        {
            var entity = _mapper.Map <db.Product>(product);
            var key    = await _ds.InsertProductAsync(entity);

            return(key);
        }