public async Task <Cipa> GetByCodigoAsync(string codigo) { var cipa = await cipasContext.Set <Cipa>().FirstOrDefaultAsync(e => e.Codigo == codigo); if (cipa != null) { await cipasContext.Entry(cipa).Collection(i => i.Membros).LoadAsync(); await cipasContext.Entry(cipa).Collection(i => i.Estabelecimentos).LoadAsync(); await cipasContext.Entry(cipa).Reference(i => i.Mandato).LoadAsync(); } return(cipa); }
public Reuniao GetById(Guid id) { var reuniao = cipasContext.Set <Reuniao>() .Include(r => r.Ata) .ThenInclude(a => a.Finalizacao) .Include(r => r.Ata) .ThenInclude(a => a.Aprovacao) .Include(r => r.Ata) .ThenInclude(a => a.Participantes) .ThenInclude(p => p.Consents) .Include(r => r.Ata) .ThenInclude(a => a.Ausentes) .ThenInclude(au => au.Consents) .Include(r => r.Ata) .ThenInclude(a => a.Assuntos) .ThenInclude(ass => ass.Alteracoes) .SingleOrDefault(p => p.Id == id); return(reuniao); }