locked
how to get student courses with entity frmework RRS feed

  • Question

  • User939559474 posted

    i have 2 classes course and student and i wanna to get student courses with student id help me please

    puplic class course
    {
        public int CourseID { get; set; }
        public string Title { get; set; }
        public string Details { get; set; }
        public string img { get; set; }
        public DateTime DateAdded { get; set; }
        public Guid UserAddID { get; set; }
        public Guid userEditID { get; set; }
        public int SubCategoryID { get; set; }
        public string Code { get; set; }
        public string Summury { get; set; }
        public decimal Price { get; set; }
        public bool IsGift { get; set; }
        public DateTime DateUpdated { get; set; }
        public bool DelFlag { get; set; }
        public DateTime? DelDate { get; set; }
        public Guid? UserDelID { get; set; }
        public ICollection<Student> Students { get; set; }
    }
    public class Student
          {
       [Key]
       public int StudentID { get; set; }
       public string Name { get; set; }
       public DateTime? DateBirth { get; set; }
       public int? Age { get; set; }
       public int? Sex { get; set; }
       public string Email { get; set; }
       public string Phone { get; set; }
       public string Mobile { get; set; }
       public string Mobile2 { get; set; }
       public string UniversityID { get; set; }
       public string CollegeID { get; set; }
       public string IdentityID { get; set; }
       public string Address { get; set; }
       public string Education { get; set; }
       public decimal? Payments { get; set; }
       public string HowToKnow { get; set; }
       public DateTime? GradeDate { get; set; }
       public string LaterCourses { get; set; }
       public string Job { get; set; }
       public string Specialist { get; set; }
       public string Notes { get; set; }
       public int StatueID { get; set; }
       public Guid? UserID { get; set; }
       public DateTime? DateAdded { get; set; }
       public Guid UserAddID { get; set; }
       public Guid userEditID { get; set; }
       public DateTime DateUpdated { get; set; }
       public bool DelFlag { get; set; }
       public DateTime? DelDate { get; set; }
       public Guid? UserDelID { get; set; }
       public virtual IList<Course> Courses { get; set; }
     }

    i wanna get all courses with StudentID using lambda expression 

    
    

    Friday, November 15, 2013 5:30 PM

Answers