I have create this model:
[Table("vwpWeekReportArchive")]
public class WeekReportArchive {
[Column("ID")]
public int Id { get; set; }
// other properties omited
}
[Table("vwpWeekReportArchiveWithActivity")]
public class WeekReportArchiveWithActivity : WeekReportArchive {
[Column("ActivityDate")]
public DateTime ActivityDate { get; set; }
[Column("ExpensePayoutType")]
public ExpensePayoutType ExpensePayoutType { get; set; }
}
In the DbContext, I have declared this DbSets:
public DbSet<WeekReportArchive> WeekReportArchives { get; set; }
public DbSet<WeekReportArchiveWithActivity> WeekReportArchivesWithActivity { get; set; }
When I use context.WeekReportArchivesWithActivity all is working great.
When I use context.WeekReportArchives EFCore creates entities of type WeekReportArchiveWithActivity too. But I want entities of type WeekReportArchiveWithActivity. The reason is, that vwpWeekReportArchive is a view, that I can update and vwpWeekReportArchiveWithActivity cannot be updated. Now for updating the entities on the database, I need to generate entities of type WeekReportArchive. How can I do this, or. what do I have to do, that EFCore will creating Entities of Type WeekReportArchive when I use context.WeekReportArchive?