What happens to a search that uses include
of Entity Framework
in a property that can be null.
var ocorrencia = db.Ocorrencia
.Include("Pessoa")
.FirstOrDefault(c => c.id == 3);
This ocorrencia
object can have the Pessoa
property as null
.
A model
:
public partial class Ocorrencia
{
[Key]
public int id { get; set; }
public Pessoa Pessoa { get; set; }
public int PessoaId { get; set; }
}
public class Pessoa
{
[Key]
public int id { get; set; }
public string nome { get; set; }
}
Will the Occurrence object be returned with the Person null object, or will nothing be returned?