public List <SalaParticularModel> GetByIdOrganizacao(int idOrganizacao) { var _blocoService = new BlocoService(_context); var _salaService = new SalaService(_context); var query = (from sp in GetAll() join sl in _salaService.GetAll() on sp.SalaId equals sl.Id join bl in _blocoService.GetByIdOrganizacao(idOrganizacao) on sl.BlocoId equals bl.Id select new SalaParticularModel { Id = sp.Id, UsuarioId = sp.UsuarioId, SalaId = sp.SalaId }).ToList(); return(query); }
public List <PlanejamentoModel> GetByIdOrganizacao(int idOrganizacao) { var _blocoService = new BlocoService(_context); var _salaService = new SalaService(_context); var query = (from pl in GetAll() join sl in _salaService.GetAll() on pl.SalaId equals sl.Id join bl in _blocoService.GetByIdOrganizacao(idOrganizacao) on sl.BlocoId equals bl.Id select new PlanejamentoModel { Id = pl.Id, DataFim = pl.DataFim, DataInicio = pl.DataInicio, DiaSemana = pl.DiaSemana, HorarioFim = pl.HorarioFim, HorarioInicio = pl.HorarioInicio, SalaId = pl.SalaId, UsuarioId = pl.UsuarioId }).ToList(); return(query); }