Conversion Method:
public Dictionary<string, string> ToPropertyDictionary(User theUser)
{
Dictionary<string, string> result = new Dictionary<string, string>();
result.Add("Name", theUser.Name);
result.Add("LastName", theUser.Name);
return result;
}
Called:
IEnumerable<Dictionary<string, string>> x =
from u in Users.AsEnumerable() //ensure local execution by using AsEnumerable
select ToPropertyDictionary(u);
source
share