public async Task <Planning> GetByIdAsync(int id) { var r = await _dpContext.Planning.FindAsync(id); _dpContext.Entry(r).State = EntityState.Detached; return(r); }
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); }