KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
continuation of the issue How get array in linq to entity? but now is not array => Dictionary City type is Dictionary var sites = (from country in db.Countries select new { Country = country.Title, Cities = country.Cities.Select(m => m.Title) }) .AsEnumerable() .Select(country => new SitiesViewByUser() { Country = country.Country, City = country.Cities.ToArray() }); update: public class SitiesViewByUser { public string Country { get; set; } public Dictionary<int, string> City { get; set; } }
Tags (comma-separated)
Save Edits
Cancel