I am trying to do join, group by and where condition using lambda expression in entity frame core but unable to return the query as IQuerayable. Below is the code -
Hide Copy Code
await _entities.Company.Join(_entities.Employee,
com => com.Company_id, emp => emp.Company_id, (com, emp) => new SearchCompany
{ companyID = com.Company_id,
industryType = com.industry_id,
company = com.Company_name,
location = com.City,
contacts = emp.Employee_phone
})
.Where(input => input.company == companyName).GroupBy(c => new { c.companyID, c.industryType, c.company, c.location })
.ToListAsync();
SearchCompany is a class with companyID,industryType,company,location,contacts as string properties and I need to return these values.
Please help me in getting it solved. Thanks in advance.
srinathPosted Jul 12, 2018, 3:03 AM
Hemant JindalPosted Jul 12, 2018, 2:25 AM
Vincent Maverick DuranoPosted Jul 12, 2018, 12:47 AM