Click here to Skip to main content
15,905,612 members

Comments by chinnuTest (Top 8 by date)

chinnuTest 9-Jul-20 12:11pm View    
var fulltimeemployees= db.Table<fulltimeemp>().Where(fl => siteId == null || fl.SiteId == siteId).ToList();

employees = db.Table<employee>()
.Where(e => fulltimeemployees.Any(fe=> fe.EmployeeId ==e.Id) || e.IsDefault)
.ToList();

Sorry, but posting one last time if you can see any mistake please let me know. These are two queries I am using but code is breaking at second one when it is executing. Is there anything wrong here ?

Thank you so much..
chinnuTest 8-Jul-20 17:02pm View    
I know with out knowing DB structure it's tough , Thank you for your help so far. but the above query I tried but It's not working when I debug query breaking at run time..

employees = db.Table<employee>()
.Where(e => fulltimeemployees.Any(fe=> fe.EmployeeId ==e.Id) || e.IsDefault)
.ToList();
chinnuTest 8-Jul-20 12:51pm View    
Sorry I did update the question completely. I am having issue at fte.id I did modified it to fte.EmployeeId but still it is not taking it.

'Guid' does not contain a definition for 'EmployeeId' and no accessible extension method 'EmployeeId' accepting a first argument of type 'Guid' could be found (are you missing a using directive or an assembly reference?)
chinnuTest 8-Jul-20 10:21am View    
Can you please any one help me on this ?
chinnuTest 7-Jul-20 14:21pm View    
Hi,

Thank you for helping me on this, but I am having issue at fte.id even I tried fte.EmployeeId -- It saying Guid doesn't have a definition for EmployeeId…. Sorry I didn't provide full information earlier updated query in my post. can you please help me ?

var employees = new List<employee>();

var fulltimeemployees= db.Table<fulltimeemp>().Where(fl => siteId == null || fl.SiteId == siteId).Select(e => e.EmployeeId);

employees = db.Table<employee>().Where(e => fulltimeemployees.Contains(e.Id) || e.IsDefault).ToList();

return employees ;