I have a query that returns only the catechizers that went to the event:
var catequizandosCheked = (from cat in db.Catequizando
where cat.Eventos.Any(e => e.EventoID == eventoID)
select new PresencaEventoViewModel
{
CatequizandoID = cat.CatequizandoID
}).ToList();
And I have another query that returns all the catechized:
var catequizandos = (from i in db.Inscricao
join c in db.Catequizando on i.CatequizandoID equals c.CatequizandoID
join p in db.Pessoa on c.CatequizandoID equals p.PessoaID
join g in db.Grupo on i.GrupoID equals g.GrupoID
where queryAnoPastoral.Contains(i.AnoPastoral)
select new PresencaEventoViewModel
{
Nome = p.Nome,
CatequizandoID = p.PessoaID,
AnoCatequese = i.AnoCatequese,
LetraGrupo = g.LetraGrupo,
Estado = !catequizandosCheked.Contains(p.PessoaID) ? "unchecked" : (catequizandosCheked.Contains(p.PessoaID) ? "checked" : null )
});
In query catequizandos
, I want to return the attribute Estado
"cheked" or "Uncheked" if found or not, the value of the catechizeID in query catequizandos