Beispiel #1
0
        public DeviceDetail AddDetail(DeviceDetail deviceDetail)
        {
            _context.DeviceDetails.Add(deviceDetail);
            _context.SaveChanges();

            return(deviceDetail);
        }
Beispiel #2
0
        public DeviceDetail UpdateDetail(DeviceDetail deviceDetail)
        {
            var device = _context.DeviceDetails.Attach(deviceDetail);

            device.State = Microsoft.EntityFrameworkCore.EntityState.Modified;

            _context.SaveChanges();

            return(deviceDetail);
        }
Beispiel #3
0
        public DeviceDetail DeleteDetail(int id)
        {
            DeviceDetail deviceDetail = _context.DeviceDetails.Find(id);

            if (deviceDetail != null)
            {
                _context.DeviceDetails.Remove(deviceDetail);
                _context.SaveChanges();
            }

            return(deviceDetail);
        }
 public DeviceDetail UpdateDetail(DeviceDetail deviceDetail)
 {
     throw new NotImplementedException();
 }