Ok I've two tables with me
Candidates
Id Name
1 Tejas
2 Mackroy
Experiences
Id Designation CandidateId isDeleted
1 Engineer 1 true
2 Developer 1 false
3 Tester 1 true
4 Engineer 2 false
5 Tester 2 true
The model classes are :
public class Candidate
{
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<Experience> Experiences { get; set; }
}
public class Experience
{
public int Id { get; set; }
public string Designation { get; set; }
public int CandidateId { get; set; }
public bool isDeleted { get; set; }
}
I wish to get GET ALL the candidates along with their Qualifications but only those where isDeleted == false .
It'll be somewhat like _DbContext.Candidates.Include("Qualifications").ToList();
So it'll be like :
{ 1 , "Tejas" , { 2, "Developer" } }, { 2, "Mackroy", { 4, "Engineer" } }
I wish to know how this can be implemented by directly using DbContext aswell as using Generic Repository .