Tuesday, 15 July 2014

linq - using one list value in another list using anonymous types -



linq - using one list value in another list using anonymous types -

i have list x anonymous types in want utilize value pre-calculated

int count1 = (from users in dc.beadsets users.userid == select users ).count(); var x = (from users in dc.users users.id == select new { username = users.username , fullname = users.firstname + " " + users.lastname , userid = users.id } ).tolist();

now working fine usual

cannot implicitly convert type 'system.collections.generic.list<anonymoustype#1>' 'system.collections.generic.list<anonymoustype#2>'

but while trying utilize throwing above error

int count1 = (from users in dc.beadsets users.userid == select users ).count(); x = (from users in dc.users users.id == select new { beadsets= count1 , username = users.username , fullname = users.firstname + " " + users.lastname , userid = users.id } ).tolist();

linq list

No comments:

Post a Comment