I have this class
public class Comment { public long Id { get; set; } public string Body { get; set; } public long OwnerId { get; set; } public virtual Account Owner { get; set; } public DateTime CreationDate { get; set; } }
the problem is that the owner of the virtual property is that I get a null object reference exception
on execution:
comment.Owner.Name
when calling this right after saving the object (from the same DbContext instance) with the new context will work
Does anyone know about this?
source share