Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Student
Id
Name

Subject
Id
Name


StudentSubject
SQL
[ForeignKey("StudentId")]
        public virtual Student Student { get; set; }
        public Guid StudentId { get; set; }

        [ForeignKey("SubjectId")]
        public virtual Subject Subject { get; set; }
        public  Guid SubjectId { get; set; }

        public decimal ChargeRate { get; set; }



when i start application firstly.Then all entities loaded properly.
when i delete some record then i check some entities not loaded properly.
Ex:
when i get student's subject like
std.StudentSubjects,then it give me information about subject null.

plz help me its urgent.
Posted
Updated 21-May-14 4:17am
v2
Comments
Ziee-M 21-May-14 11:40am    
I don't see why you are linking your error to entity framwork, generally if one operations works the others should work too! debug step by step and check all you variables, instances and lists stored data until you reach the null reference.
RahulRana723 22-May-14 0:13am    
thanks for reply.it give me subjectid but it give subject null

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900