Пример #1
0
        public Data.Vehicle Update(Data.Vehicle entity)
        {
            var oldEntity = _context.Vehicles.Find(entity.Id);

            _context.Entry(oldEntity).CurrentValues.SetValues(entity);

            return(entity);
        }
Пример #2
0
        public async Task <Data.Vehicle> Create(Data.Vehicle entity)
        {
            await _context.AddAsync(entity);

            return(entity);
        }