I am essentially am trying to find a clean way to pull in data from another table. Below is a simplified version of my model. My goal is to put the platform name in the userplatform. I would like the cleanest way to do this so I assume with automapper or directly in my repository.
When I try to put a virtual reference to Platform in User Platform my code gets an error that we have a loop of cascading deletes.
Any ideas on how to resolve this problem?
public class User
{
public int UserID { get; set; }
public virtual ICollection<UserPlatform> UserPlatform { get; set; }
}
public class UserPlatform
{
public int UserPlatformID { get; set; }
public String PlatformName { get; set; }
public int UserID { get; set; }
}
public class Platform
{
public int PlatformID { get; set; }
public string Name { get; set; }
}