Showing posts with label WTF. Show all posts
Showing posts with label WTF. Show all posts

Friday, March 28, 2014

youtube blocked in turkey

Me on my blog generally sharing my favourite songs from youtube and our precious country blocks youtube.

Fucking fine.

I would share a Vaya Con Dios and love her tone.


Thursday, January 20, 2011

Linq Spagetti

 //Property Options
            IDictionaryAdvertPropertyint> 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);