I have 2 tables in db - one EmploymentRecordsoneEmploymentVerificationRecords
I want to query both tables and return one List
I have a model (simplified example):
Public Class Record
{
int ID {get; set;}
string name {get; set;}
bool IsVerification {get; set;}
}
I want to have some type of query in LINQ, for example:
var records = from a in _context.EmploymentRecords
join b in _context.EmploymentVerificationRecords on a.id equals b.id
where a.UserID = 1
select new Record() { .ID = a.id, .name = a.name, .IsVerification = false}
see. - I also need a new one Record(), added to the results for each record found in the second table, for these results there IsVerificationwill beTrue
source
share