I have this model:
public class Project
{
public int Id { get; set; }
public int? ParentId { get; set; }
// some more properties...
public List<Project> ChildProjects { get; set; }
}
In the database, the column "ProjectId" is created, which is used to keep track of the relationship to the parent project.
Since "ProjectId" is not part of the entity model, I can't reference it in my queries.
How can I prevent this column from being created, and use "ParentId" instead?
UPDATE
This is my DbContext:
public class ProjectsDbContext : DbContext
{
public ProjectsDbContext(DbContextOptions<ProjectsDbContext> options) : base(options) { }
public DbSet<Project> Projects { get; set; }
}