public Route DeleteRoute(int id)
        {
            var route = _context.Remove(new Route {
                Id = id
            }).Entity;

            _context.SaveChanges();
            return(route);
        }
Esempio n. 2
0
        public Group DeleteGroup(int id)
        {
            var group = _context.Remove(new Group {
                Id = id
            }).Entity;

            _context.SaveChanges();
            return(group);
        }
Esempio n. 3
0
        public Shift DeleteShift(int id)
        {
            var shift = _context.Remove(new Shift {
                Id = id
            }).Entity;

            _context.SaveChanges();
            return(shift);
        }
        public User DeleteUser(int id)
        {
            var user = _context.Remove(new User {
                Id = id
            }).Entity;

            _context.SaveChanges();
            return(user);
        }
        public ActiveRoute DeleteActiveRoute(int id)
        {
            var deletedARoute = _context.Remove(new ActiveRoute()
            {
                id = id
            }).Entity;

            _context.SaveChanges();
            return(deletedARoute);
        }
        public PendingShift DeletePendingShift(int id)
        {
            _context.UserPendingShifts.RemoveRange(
                _context.UserPendingShifts.Where(ups => ups.PendingShiftId == id));
            var pendingShift = _context.Remove(new PendingShift {
                Id = id
            }).Entity;

            _context.SaveChanges();
            return(pendingShift);
        }