public FloorDto GetFloor(int id) { var floor = _floorRepository.Get(id); if (floor == null) { return(null); } return(DTOMapper.GetFloorDto(floor)); }
public FloorDto GetEmployeeFloor(int id) { var employee = _repository.Get(id); var floors = _floorRepository.Floors.Select(x => DTOMapper.GetFloorDto(x)); if (employee == null || floors == null) { return(null); } var employeeRoomId = employee.Seat.RoomId; var employeeFloor = floors.Where(f => f.Rooms.Where(r => r.Id == employeeRoomId).First().Id == employeeRoomId).First(); if (employeeFloor == null) { return(null); } return(employeeFloor); }
public IEnumerable <FloorDto> GetAllFloors() { return(_floorRepository.Floors.Select(x => DTOMapper.GetFloorDto(x))); }