//Property Options IDictionaryAdvertProperty, int> advertPropertyGroupList = (from r in resultPropertyOption where r.AdvertPropertyID != null && r.AdvertPropertyOptionID != null && r.OptionCount != 0 group r by r.AdvertPropertyID into g select new { C = new EmlakMilliyet.Service.Model.AdvertSearch.AdvertProperty { Id = (int)g.Key.Value, Name = this.AdvertLookupDataService.GetAdvertProperty((int)g.Key.Value).Name, Options = (from v in g select new { L = this.AdvertLookupDataService.GetAdvertPropertyOption((int)g.Key.Value, (int)v.AdvertPropertyOptionID) ?? new AdvertPropertyOption { Id = 0, Name = "", SearchOptionOrder = 0 }, TotalCount = g.Where(w => w.AdvertPropertyOptionID == v.AdvertPropertyOptionID).Sum(a => a.OptionCount.GetValueOrDefault()) }) .OrderBy(o => o.L.Name) .ToDictionary(p => p.L, p => p.TotalCount) }, TotalCount = g.Sum(a => a.OptionCount.GetValueOrDefault()) }).OrderBy(o => o.C.Name).ToDictionary(p => p.C, p => p.TotalCount);
mix perspectives and perceptions then approach with embracement. literally advanced search user on programming world.
Thursday, January 20, 2011
Linq Spagetti
Labels:
WTF
Subscribe to:
Post Comments (Atom)
2 comments:
I think one of your advertisements caused my internet browser to resize, you might want to put that on your blacklist.
Oh, yes, Linq can cause unreadable spagetti. I think it's a worldwide-common problem.
Post a Comment