Main Class
Class TimeMaster {
Public string parameter1 { get; set; }
Public string parameter2{ get; set; }
Public string parameter3 { get; set; }
}
I wanted backup of TimeMaster table so I created BTimeMaster table for backup so BTimeMaster class use all main table parameter and one added acdemicyear parameter extra.
Backup Class
public class BTimeMaster : TimeMaster
{
[Required(ErrorMessage = "Required!")]
[DisplayName("AcademicYear")]
public string AcademicYear { get; set; }
}
but when I called following function
var firstContext = new TimetableContext();
foreach (var first in firstContext.TimeMaster)
{
}
I cannot used like below if added [NotMapped] in class BTimeMaster and also want to map to a field and class BTimeMaster on the DB.
var SecondContext = new BackupContext();
foreach (var secondin SecondContext.BTimeMaster)
{
}
Error showed
which step I missed when inheritance for parent class when used [NotMapped] for AcademicYear then it worked but i wanted AcademicYear for my backup table