I need help defining the correct class declaration
Follow my code:
public void BuscaOcorremcias()
{
//Op 01 - Declarando um IList da Model
IList<Ocorrencia> ocorrencias = null;
//Op 02 - Declarando um DbSet
System.Data.Entity.DbSet<MoradaWeb.Models.Ocorrencia> ocorrencias = null;
ocorrencias = db.Ocorrencia.Include("Pessoa").Where(c => c.status == true);
if (MinhaRegradeNegocio)
ocorrencias = ocorrencias.Where(c => c.Pessoa == PessoaLogada);
}
// My Context
public class MeuContext : DbContext
{
public MoradaWebContext() : base("name=MinhaConnectionString")
{ ... }
public System.Data.Entity.DbSet<Models.Ocorrencia> Ocorrencia { get; set; }
}
The error that gives the two options above (in the code comment) is this:
Can not implicitly convert type ...
I'm not sure which type to declare so I can keep the condition of applying a Where else if I need to. In this case I want to make the second where within the collection itself that has already been searched in the database.