I am using .NET MVC 5 and entity framework I have this model :
public class Division
{
public int Id { get; set; }
[Required]
[StringLength(50)]
public string Name { get; set; }
public virtual IList<Department> Departments { get; set; }
[Display(Name = "Manager")]
public string ManagerId { get; set; }
[ForeignKey("ManagerId")]
public virtual AppUser Manager { get; set; }
public virtual IList<AppUser> Users { get; set; }
}
So the Division Has a Manager.
When I keep the App running for a while, All related managers are removed without me doing any thing ! Only the relation is removed ( ManagerId = null ) instead of the Id, but they still there in the Users table.
Any suggestions will be appreciated.
(Edit)
Thank you Carl,
I put a Trigger on the table divisions, and I noticed that it get updated when I leave the app running for a while and then try to enter any page !