Using linq I am trying to get a List[Guid], but I am not able to.
I tried this:
var myGuidList = from x in
mydatasource
where x.Field==value
select new Guid(){x.TheGuid}; <- Problem here
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not clear what the type of
TheGuidproperty is but if it is a string you could use the following:And if it is a Guid, well, you could select it directly:
and if you want to get a
List<Guid>, simply use the.ToList()extension method on the result: