Example #1
0
        public async Task <Planning> GetByIdAsync(int id)
        {
            var r = await _dpContext.Planning.FindAsync(id);

            _dpContext.Entry(r).State = EntityState.Detached;

            return(r);
        }
Example #2
0
        public async Task <List <Desk> > GetAllDesksForRoomAsync(int roomId)
        {
            var desks = await _dpContext.Desk.Where(d => d.RoomId == roomId)
                        .ToListAsync();

            foreach (var desk in desks)
            {
                _dpContext.Entry(desk).State = EntityState.Detached;
            }

            return(desks);
        }