コード例 #1
0
        public async Task <bool> EditProduct(ProductEditRAO rao)
        {
            var entity = _mapper.Map <ProductEntity>(rao);

            _context.ProductTableAccess.Update(entity);

            return(await _context.SaveChangesAsync() == 1);
        }
コード例 #2
0
        public async Task <bool> ProductEdit(ProductEditRAO rao)
        {
            var entity = await _context.ProductTableAccess.FirstOrDefaultAsync(x => x.ProductId == rao.ProductId);

            entity.Year      = rao.Year;
            entity.Name      = rao.Name;
            entity.Type      = rao.Type;
            entity.Condition = rao.Condition;

            return(await _context.SaveChangesAsync() == 1);
        }