[{"data":1,"prerenderedAt":6235},["ShallowReactive",2],{"blog:2009:client-side-properties-and-any-remote-linq-provider":3,"blogMore-Development":2232,"comments-client-side-properties-and-any-remote-linq-provider":2245},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"excerpt":11,"category":29,"tags":30,"body":35,"_type":2223,"_id":2224,"_source":2225,"_file":2226,"_stem":2227,"_extension":2228,"url":2229,"wordCount":2230,"minutes":225,"commentCount":2231},"/blog/2009/client-side-properties-and-any-remote-linq-provider","2009",false,"en","Client-side properties and any remote LINQ provider","David Fowler on the ASP.NET team and I have been bouncing ideas about how to solve an annoyance using LINQ:","2009-06-24T12:05:00+00:00",{"type":12,"children":13},"root",[14,24],{"type":15,"tag":16,"props":17,"children":18},"element","p",{},[19,22],{"type":20,"value":21},"text","David Fowler",{"type":20,"value":23}," on the ASP.NET team and I have been bouncing ideas about how to solve an annoyance using LINQ:",{"type":15,"tag":16,"props":25,"children":26},{},[27],{"type":20,"value":28},"If you write properties on the client, you can’t use them in remote LINQ operations.","Development",[31,32,33,34],".NET","Entity Framework","LINQ","C#",{"type":12,"children":36,"toc":2208},[37,49,57,62,67,81,88,93,608,614,619,1395,1401,1421,1427,1432,1447,1452,1459,1464,1793,1798,1804,1809,1814,2065,2071,2077,2082,2088,2093,2099,2104,2110,2115,2188,2193,2202],{"type":15,"tag":16,"props":38,"children":39},{},[40,48],{"type":15,"tag":41,"props":42,"children":46},"a",{"href":43,"rel":44},"https://weblogs.asp.net/davidfowler/",[45],"nofollow",[47],{"type":20,"value":21},{"type":20,"value":23},{"type":15,"tag":50,"props":51,"children":52},"blockquote",{},[53],{"type":15,"tag":16,"props":54,"children":55},{},[56],{"type":20,"value":28},{"type":15,"tag":16,"props":58,"children":59},{},[60],{"type":20,"value":61},"The problem occurs because these properties can’t be translated and sent to the server. They have been compiled into Intermediate Language (IL) and not expression trees. LINQ requires expression trees to translate them using IQueryable providers. There is nothing available in .NET to let us reverse-engineer the IL back into the methods and syntax that would allow us to translate the intended operation into a remote query.",{"type":15,"tag":16,"props":63,"children":64},{},[65],{"type":20,"value":66},"This means you end up having to write your query in two parts. Firstly, the part the server can perform. Then a ToList or AsEnumerable call to force that to happen and bring the intermediate results down to the client. Then the second part with operations that must be evaluated locally. This process can hurt performance if you want to reduce or transform the result set significantly.",{"type":15,"tag":16,"props":68,"children":69},{},[70,72,79],{"type":20,"value":71},"What David, ",{"type":15,"tag":41,"props":73,"children":76},{"href":74,"rel":75},"https://blogs.msdn.com/meek/",[45],[77],{"type":20,"value":78},"Colin Meek",{"type":20,"value":80},", and I came up with is a provider-independent way of declaring properties just once so they are usable in both scenarios. Computed properties for LINQ to SQL, LINQ to Entities and anything else LINQ enabled with little effort, and it works on .NET 3.5 SP1 :)",{"type":15,"tag":82,"props":83,"children":85},"h2",{"id":84},"before-example",[86],{"type":20,"value":87},"Before example",{"type":15,"tag":16,"props":89,"children":90},{},[91],{"type":20,"value":92},"Here we have extended the Employee class to add Age and FullName. We only wanted people with “da” in their name but are forced to pull everything to the client to perform the selection.",{"type":15,"tag":94,"props":95,"children":100},"pre",{"className":96,"code":97,"language":98,"meta":99,"style":99},"language-csharp shiki shiki-themes everforest-light dracula","partial class Employee {\n  public string FullName {\n    get { return Forename + \" \" + Surname; }\n  }\n\n  public int Age {\n    get { return DateTime.Now.Year - BirthDate.Year - (((DateTime.Now.Month \u003C BirthDate.Month)\n            || DateTime.Now.Month == BirthDate.Month && DateTime.Now.Day \u003C BirthDate.Day) ? 1 : 0));\n    }\n  }\n}\n\nvar employees = db.Employees.ToList().Where(e => e.FullName.Contains(\"da\")).GroupBy(e => e.Age);\n","csharp","",[101],{"type":15,"tag":102,"props":103,"children":104},"code",{"__ignoreMap":99},[105,135,155,204,213,223,241,332,435,444,452,461,469],{"type":15,"tag":106,"props":107,"children":110},"span",{"class":108,"line":109},"line",1,[111,117,123,129],{"type":15,"tag":106,"props":112,"children":114},{"style":113},"--shiki-default:#F57D26;--shiki-dark:#FF79C6",[115],{"type":20,"value":116},"partial",{"type":15,"tag":106,"props":118,"children":120},{"style":119},"--shiki-default:#F85552;--shiki-dark:#FF79C6",[121],{"type":20,"value":122}," class",{"type":15,"tag":106,"props":124,"children":126},{"style":125},"--shiki-default:#3A94C5;--shiki-dark:#8BE9FD",[127],{"type":20,"value":128}," Employee",{"type":15,"tag":106,"props":130,"children":132},{"style":131},"--shiki-default:#5C6A72;--shiki-dark:#F8F8F2",[133],{"type":20,"value":134}," {\n",{"type":15,"tag":106,"props":136,"children":138},{"class":108,"line":137},2,[139,144,150],{"type":15,"tag":106,"props":140,"children":141},{"style":113},[142],{"type":20,"value":143},"  public",{"type":15,"tag":106,"props":145,"children":147},{"style":146},"--shiki-default:#3A94C5;--shiki-dark:#FF79C6",[148],{"type":20,"value":149}," string",{"type":15,"tag":106,"props":151,"children":152},{"style":131},[153],{"type":20,"value":154}," FullName {\n",{"type":15,"tag":106,"props":156,"children":158},{"class":108,"line":157},3,[159,164,169,174,179,184,190,194,199],{"type":15,"tag":106,"props":160,"children":161},{"style":146},[162],{"type":20,"value":163},"    get",{"type":15,"tag":106,"props":165,"children":166},{"style":131},[167],{"type":20,"value":168}," { ",{"type":15,"tag":106,"props":170,"children":171},{"style":119},[172],{"type":20,"value":173},"return",{"type":15,"tag":106,"props":175,"children":176},{"style":131},[177],{"type":20,"value":178}," Forename ",{"type":15,"tag":106,"props":180,"children":181},{"style":113},[182],{"type":20,"value":183},"+",{"type":15,"tag":106,"props":185,"children":187},{"style":186},"--shiki-default:#8DA101;--shiki-dark:#E9F284",[188],{"type":20,"value":189}," \"",{"type":15,"tag":106,"props":191,"children":192},{"style":186},[193],{"type":20,"value":189},{"type":15,"tag":106,"props":195,"children":196},{"style":113},[197],{"type":20,"value":198}," +",{"type":15,"tag":106,"props":200,"children":201},{"style":131},[202],{"type":20,"value":203}," Surname; }\n",{"type":15,"tag":106,"props":205,"children":207},{"class":108,"line":206},4,[208],{"type":15,"tag":106,"props":209,"children":210},{"style":131},[211],{"type":20,"value":212},"  }\n",{"type":15,"tag":106,"props":214,"children":216},{"class":108,"line":215},5,[217],{"type":15,"tag":106,"props":218,"children":220},{"emptyLinePlaceholder":219},true,[221],{"type":20,"value":222},"\n",{"type":15,"tag":106,"props":224,"children":226},{"class":108,"line":225},6,[227,231,236],{"type":15,"tag":106,"props":228,"children":229},{"style":113},[230],{"type":20,"value":143},{"type":15,"tag":106,"props":232,"children":233},{"style":146},[234],{"type":20,"value":235}," int",{"type":15,"tag":106,"props":237,"children":238},{"style":131},[239],{"type":20,"value":240}," Age {\n",{"type":15,"tag":106,"props":242,"children":244},{"class":108,"line":243},7,[245,249,253,257,262,268,273,278,283,288,292,296,301,305,309,314,319,323,327],{"type":15,"tag":106,"props":246,"children":247},{"style":146},[248],{"type":20,"value":163},{"type":15,"tag":106,"props":250,"children":251},{"style":131},[252],{"type":20,"value":168},{"type":15,"tag":106,"props":254,"children":255},{"style":119},[256],{"type":20,"value":173},{"type":15,"tag":106,"props":258,"children":259},{"style":131},[260],{"type":20,"value":261}," DateTime.",{"type":15,"tag":106,"props":263,"children":265},{"style":264},"--shiki-default:#35A77C;--shiki-dark:#F8F8F2",[266],{"type":20,"value":267},"Now",{"type":15,"tag":106,"props":269,"children":270},{"style":131},[271],{"type":20,"value":272},".",{"type":15,"tag":106,"props":274,"children":275},{"style":264},[276],{"type":20,"value":277},"Year",{"type":15,"tag":106,"props":279,"children":280},{"style":113},[281],{"type":20,"value":282}," -",{"type":15,"tag":106,"props":284,"children":285},{"style":131},[286],{"type":20,"value":287}," BirthDate.",{"type":15,"tag":106,"props":289,"children":290},{"style":264},[291],{"type":20,"value":277},{"type":15,"tag":106,"props":293,"children":294},{"style":113},[295],{"type":20,"value":282},{"type":15,"tag":106,"props":297,"children":298},{"style":131},[299],{"type":20,"value":300}," (((DateTime.",{"type":15,"tag":106,"props":302,"children":303},{"style":264},[304],{"type":20,"value":267},{"type":15,"tag":106,"props":306,"children":307},{"style":131},[308],{"type":20,"value":272},{"type":15,"tag":106,"props":310,"children":311},{"style":264},[312],{"type":20,"value":313},"Month",{"type":15,"tag":106,"props":315,"children":316},{"style":113},[317],{"type":20,"value":318}," \u003C",{"type":15,"tag":106,"props":320,"children":321},{"style":131},[322],{"type":20,"value":287},{"type":15,"tag":106,"props":324,"children":325},{"style":264},[326],{"type":20,"value":313},{"type":15,"tag":106,"props":328,"children":329},{"style":131},[330],{"type":20,"value":331},")\n",{"type":15,"tag":106,"props":333,"children":335},{"class":108,"line":334},8,[336,341,345,349,353,357,362,366,370,375,379,383,387,392,396,400,404,409,414,420,425,430],{"type":15,"tag":106,"props":337,"children":338},{"style":113},[339],{"type":20,"value":340},"            ||",{"type":15,"tag":106,"props":342,"children":343},{"style":131},[344],{"type":20,"value":261},{"type":15,"tag":106,"props":346,"children":347},{"style":264},[348],{"type":20,"value":267},{"type":15,"tag":106,"props":350,"children":351},{"style":131},[352],{"type":20,"value":272},{"type":15,"tag":106,"props":354,"children":355},{"style":264},[356],{"type":20,"value":313},{"type":15,"tag":106,"props":358,"children":359},{"style":113},[360],{"type":20,"value":361}," ==",{"type":15,"tag":106,"props":363,"children":364},{"style":131},[365],{"type":20,"value":287},{"type":15,"tag":106,"props":367,"children":368},{"style":264},[369],{"type":20,"value":313},{"type":15,"tag":106,"props":371,"children":372},{"style":113},[373],{"type":20,"value":374}," &&",{"type":15,"tag":106,"props":376,"children":377},{"style":131},[378],{"type":20,"value":261},{"type":15,"tag":106,"props":380,"children":381},{"style":264},[382],{"type":20,"value":267},{"type":15,"tag":106,"props":384,"children":385},{"style":131},[386],{"type":20,"value":272},{"type":15,"tag":106,"props":388,"children":389},{"style":264},[390],{"type":20,"value":391},"Day",{"type":15,"tag":106,"props":393,"children":394},{"style":113},[395],{"type":20,"value":318},{"type":15,"tag":106,"props":397,"children":398},{"style":131},[399],{"type":20,"value":287},{"type":15,"tag":106,"props":401,"children":402},{"style":264},[403],{"type":20,"value":391},{"type":15,"tag":106,"props":405,"children":406},{"style":131},[407],{"type":20,"value":408},") ",{"type":15,"tag":106,"props":410,"children":411},{"style":113},[412],{"type":20,"value":413},"?",{"type":15,"tag":106,"props":415,"children":417},{"style":416},"--shiki-default:#DF69BA;--shiki-dark:#BD93F9",[418],{"type":20,"value":419}," 1",{"type":15,"tag":106,"props":421,"children":422},{"style":113},[423],{"type":20,"value":424}," :",{"type":15,"tag":106,"props":426,"children":427},{"style":416},[428],{"type":20,"value":429}," 0",{"type":15,"tag":106,"props":431,"children":432},{"style":131},[433],{"type":20,"value":434},"));\n",{"type":15,"tag":106,"props":436,"children":438},{"class":108,"line":437},9,[439],{"type":15,"tag":106,"props":440,"children":441},{"style":131},[442],{"type":20,"value":443},"    }\n",{"type":15,"tag":106,"props":445,"children":447},{"class":108,"line":446},10,[448],{"type":15,"tag":106,"props":449,"children":450},{"style":131},[451],{"type":20,"value":212},{"type":15,"tag":106,"props":453,"children":455},{"class":108,"line":454},11,[456],{"type":15,"tag":106,"props":457,"children":458},{"style":131},[459],{"type":20,"value":460},"}\n",{"type":15,"tag":106,"props":462,"children":464},{"class":108,"line":463},12,[465],{"type":15,"tag":106,"props":466,"children":467},{"emptyLinePlaceholder":219},[468],{"type":20,"value":222},{"type":15,"tag":106,"props":470,"children":472},{"class":108,"line":471},13,[473,478,483,488,493,498,502,508,513,518,523,529,534,539,544,548,553,557,562,568,572,577,582,586,590,594,598,603],{"type":15,"tag":106,"props":474,"children":475},{"style":146},[476],{"type":20,"value":477},"var",{"type":15,"tag":106,"props":479,"children":480},{"style":131},[481],{"type":20,"value":482}," employees ",{"type":15,"tag":106,"props":484,"children":485},{"style":113},[486],{"type":20,"value":487},"=",{"type":15,"tag":106,"props":489,"children":490},{"style":131},[491],{"type":20,"value":492}," db.",{"type":15,"tag":106,"props":494,"children":495},{"style":264},[496],{"type":20,"value":497},"Employees",{"type":15,"tag":106,"props":499,"children":500},{"style":131},[501],{"type":20,"value":272},{"type":15,"tag":106,"props":503,"children":505},{"style":504},"--shiki-default:#8DA101;--shiki-dark:#50FA7B",[506],{"type":20,"value":507},"ToList",{"type":15,"tag":106,"props":509,"children":510},{"style":131},[511],{"type":20,"value":512},"().",{"type":15,"tag":106,"props":514,"children":515},{"style":504},[516],{"type":20,"value":517},"Where",{"type":15,"tag":106,"props":519,"children":520},{"style":131},[521],{"type":20,"value":522},"(",{"type":15,"tag":106,"props":524,"children":526},{"style":525},"--shiki-default:#5C6A72;--shiki-default-font-style:inherit;--shiki-dark:#FFB86C;--shiki-dark-font-style:italic",[527],{"type":20,"value":528},"e",{"type":15,"tag":106,"props":530,"children":531},{"style":113},[532],{"type":20,"value":533}," =>",{"type":15,"tag":106,"props":535,"children":536},{"style":131},[537],{"type":20,"value":538}," e.",{"type":15,"tag":106,"props":540,"children":541},{"style":264},[542],{"type":20,"value":543},"FullName",{"type":15,"tag":106,"props":545,"children":546},{"style":131},[547],{"type":20,"value":272},{"type":15,"tag":106,"props":549,"children":550},{"style":504},[551],{"type":20,"value":552},"Contains",{"type":15,"tag":106,"props":554,"children":555},{"style":131},[556],{"type":20,"value":522},{"type":15,"tag":106,"props":558,"children":559},{"style":186},[560],{"type":20,"value":561},"\"",{"type":15,"tag":106,"props":563,"children":565},{"style":564},"--shiki-default:#8DA101;--shiki-dark:#F1FA8C",[566],{"type":20,"value":567},"da",{"type":15,"tag":106,"props":569,"children":570},{"style":186},[571],{"type":20,"value":561},{"type":15,"tag":106,"props":573,"children":574},{"style":131},[575],{"type":20,"value":576},")).",{"type":15,"tag":106,"props":578,"children":579},{"style":504},[580],{"type":20,"value":581},"GroupBy",{"type":15,"tag":106,"props":583,"children":584},{"style":131},[585],{"type":20,"value":522},{"type":15,"tag":106,"props":587,"children":588},{"style":525},[589],{"type":20,"value":528},{"type":15,"tag":106,"props":591,"children":592},{"style":113},[593],{"type":20,"value":533},{"type":15,"tag":106,"props":595,"children":596},{"style":131},[597],{"type":20,"value":538},{"type":15,"tag":106,"props":599,"children":600},{"style":264},[601],{"type":20,"value":602},"Age",{"type":15,"tag":106,"props":604,"children":605},{"style":131},[606],{"type":20,"value":607},");\n",{"type":15,"tag":82,"props":609,"children":611},{"id":610},"after-example",[612],{"type":20,"value":613},"After example",{"type":15,"tag":16,"props":615,"children":616},{},[617],{"type":20,"value":618},"Here, using our approach, it all happens server-side and works on both LINQ to Entities and LINQ to SQL.",{"type":15,"tag":94,"props":620,"children":622},{"className":96,"code":621,"language":98,"meta":99,"style":99},"partial class Employee {\n    private static readonly CompiledExpression\u003CEmployee,string> fullNameExpression\n     = DefaultTranslationOf\u003CEmployee>.Property(e => e.FullName).Is(e => e.Forename + \" \" + e.Surname);\n    private static readonly CompiledExpression\u003CEmployee,int> ageExpression\n     = DefaultTranslationOf\u003CEmployee>.Property(e => e.Age).Is(e => DateTime.Now.Year - e.BirthDate.Value.Year - (((DateTime.Now.Month \u003C e.BirthDate.Value.Month) || (DateTime.Now.Month == e.BirthDate.Value.Month && DateTime.Now.Day \u003C e.BirthDate.Value.Day)) ? 1 : 0)));\n\n  public string FullName {\n    get { return fullNameExpression.Evaluate(this); }\n  }\n\n  public int Age {\n    get { return ageExpression.Evaluate(this); }\n  }\n}\n\nvar employees = db.Employees.Where(e => e.FullName.Contains(\"da\")).GroupBy(e => e.Age).WithTranslations();\n",[623],{"type":15,"tag":102,"props":624,"children":625},{"__ignoreMap":99},[626,645,694,801,842,1127,1134,1149,1189,1196,1203,1218,1254,1261,1269,1277],{"type":15,"tag":106,"props":627,"children":628},{"class":108,"line":109},[629,633,637,641],{"type":15,"tag":106,"props":630,"children":631},{"style":113},[632],{"type":20,"value":116},{"type":15,"tag":106,"props":634,"children":635},{"style":119},[636],{"type":20,"value":122},{"type":15,"tag":106,"props":638,"children":639},{"style":125},[640],{"type":20,"value":128},{"type":15,"tag":106,"props":642,"children":643},{"style":131},[644],{"type":20,"value":134},{"type":15,"tag":106,"props":646,"children":647},{"class":108,"line":137},[648,653,658,663,669,674,679,684,689],{"type":15,"tag":106,"props":649,"children":650},{"style":113},[651],{"type":20,"value":652},"    private",{"type":15,"tag":106,"props":654,"children":655},{"style":113},[656],{"type":20,"value":657}," static",{"type":15,"tag":106,"props":659,"children":660},{"style":113},[661],{"type":20,"value":662}," readonly",{"type":15,"tag":106,"props":664,"children":666},{"style":665},"--shiki-default:#3A94C5;--shiki-default-font-style:inherit;--shiki-dark:#8BE9FD;--shiki-dark-font-style:italic",[667],{"type":20,"value":668}," CompiledExpression",{"type":15,"tag":106,"props":670,"children":671},{"style":131},[672],{"type":20,"value":673},"\u003C",{"type":15,"tag":106,"props":675,"children":676},{"style":665},[677],{"type":20,"value":678},"Employee",{"type":15,"tag":106,"props":680,"children":681},{"style":131},[682],{"type":20,"value":683},",",{"type":15,"tag":106,"props":685,"children":686},{"style":146},[687],{"type":20,"value":688},"string",{"type":15,"tag":106,"props":690,"children":691},{"style":131},[692],{"type":20,"value":693},"> fullNameExpression\n",{"type":15,"tag":106,"props":695,"children":696},{"class":108,"line":157},[697,702,707,711,716,721,725,729,733,737,741,746,751,755,759,763,767,772,776,780,784,788,792,797],{"type":15,"tag":106,"props":698,"children":699},{"style":113},[700],{"type":20,"value":701},"     =",{"type":15,"tag":106,"props":703,"children":704},{"style":131},[705],{"type":20,"value":706}," DefaultTranslationOf\u003C",{"type":15,"tag":106,"props":708,"children":709},{"style":665},[710],{"type":20,"value":678},{"type":15,"tag":106,"props":712,"children":713},{"style":131},[714],{"type":20,"value":715},">.",{"type":15,"tag":106,"props":717,"children":718},{"style":504},[719],{"type":20,"value":720},"Property",{"type":15,"tag":106,"props":722,"children":723},{"style":131},[724],{"type":20,"value":522},{"type":15,"tag":106,"props":726,"children":727},{"style":525},[728],{"type":20,"value":528},{"type":15,"tag":106,"props":730,"children":731},{"style":113},[732],{"type":20,"value":533},{"type":15,"tag":106,"props":734,"children":735},{"style":131},[736],{"type":20,"value":538},{"type":15,"tag":106,"props":738,"children":739},{"style":264},[740],{"type":20,"value":543},{"type":15,"tag":106,"props":742,"children":743},{"style":131},[744],{"type":20,"value":745},").",{"type":15,"tag":106,"props":747,"children":748},{"style":504},[749],{"type":20,"value":750},"Is",{"type":15,"tag":106,"props":752,"children":753},{"style":131},[754],{"type":20,"value":522},{"type":15,"tag":106,"props":756,"children":757},{"style":525},[758],{"type":20,"value":528},{"type":15,"tag":106,"props":760,"children":761},{"style":113},[762],{"type":20,"value":533},{"type":15,"tag":106,"props":764,"children":765},{"style":131},[766],{"type":20,"value":538},{"type":15,"tag":106,"props":768,"children":769},{"style":264},[770],{"type":20,"value":771},"Forename",{"type":15,"tag":106,"props":773,"children":774},{"style":113},[775],{"type":20,"value":198},{"type":15,"tag":106,"props":777,"children":778},{"style":186},[779],{"type":20,"value":189},{"type":15,"tag":106,"props":781,"children":782},{"style":186},[783],{"type":20,"value":189},{"type":15,"tag":106,"props":785,"children":786},{"style":113},[787],{"type":20,"value":198},{"type":15,"tag":106,"props":789,"children":790},{"style":131},[791],{"type":20,"value":538},{"type":15,"tag":106,"props":793,"children":794},{"style":264},[795],{"type":20,"value":796},"Surname",{"type":15,"tag":106,"props":798,"children":799},{"style":131},[800],{"type":20,"value":607},{"type":15,"tag":106,"props":802,"children":803},{"class":108,"line":206},[804,808,812,816,820,824,828,832,837],{"type":15,"tag":106,"props":805,"children":806},{"style":113},[807],{"type":20,"value":652},{"type":15,"tag":106,"props":809,"children":810},{"style":113},[811],{"type":20,"value":657},{"type":15,"tag":106,"props":813,"children":814},{"style":113},[815],{"type":20,"value":662},{"type":15,"tag":106,"props":817,"children":818},{"style":665},[819],{"type":20,"value":668},{"type":15,"tag":106,"props":821,"children":822},{"style":131},[823],{"type":20,"value":673},{"type":15,"tag":106,"props":825,"children":826},{"style":665},[827],{"type":20,"value":678},{"type":15,"tag":106,"props":829,"children":830},{"style":131},[831],{"type":20,"value":683},{"type":15,"tag":106,"props":833,"children":834},{"style":146},[835],{"type":20,"value":836},"int",{"type":15,"tag":106,"props":838,"children":839},{"style":131},[840],{"type":20,"value":841},"> ageExpression\n",{"type":15,"tag":106,"props":843,"children":844},{"class":108,"line":215},[845,849,853,857,861,865,869,873,877,881,885,889,893,897,901,905,909,913,917,921,925,929,934,938,943,947,951,955,959,963,967,971,975,979,983,987,991,995,999,1003,1008,1013,1017,1021,1025,1029,1033,1037,1041,1045,1049,1053,1057,1061,1065,1069,1073,1077,1081,1085,1089,1093,1097,1101,1106,1110,1114,1118,1122],{"type":15,"tag":106,"props":846,"children":847},{"style":113},[848],{"type":20,"value":701},{"type":15,"tag":106,"props":850,"children":851},{"style":131},[852],{"type":20,"value":706},{"type":15,"tag":106,"props":854,"children":855},{"style":665},[856],{"type":20,"value":678},{"type":15,"tag":106,"props":858,"children":859},{"style":131},[860],{"type":20,"value":715},{"type":15,"tag":106,"props":862,"children":863},{"style":504},[864],{"type":20,"value":720},{"type":15,"tag":106,"props":866,"children":867},{"style":131},[868],{"type":20,"value":522},{"type":15,"tag":106,"props":870,"children":871},{"style":525},[872],{"type":20,"value":528},{"type":15,"tag":106,"props":874,"children":875},{"style":113},[876],{"type":20,"value":533},{"type":15,"tag":106,"props":878,"children":879},{"style":131},[880],{"type":20,"value":538},{"type":15,"tag":106,"props":882,"children":883},{"style":264},[884],{"type":20,"value":602},{"type":15,"tag":106,"props":886,"children":887},{"style":131},[888],{"type":20,"value":745},{"type":15,"tag":106,"props":890,"children":891},{"style":504},[892],{"type":20,"value":750},{"type":15,"tag":106,"props":894,"children":895},{"style":131},[896],{"type":20,"value":522},{"type":15,"tag":106,"props":898,"children":899},{"style":525},[900],{"type":20,"value":528},{"type":15,"tag":106,"props":902,"children":903},{"style":113},[904],{"type":20,"value":533},{"type":15,"tag":106,"props":906,"children":907},{"style":131},[908],{"type":20,"value":261},{"type":15,"tag":106,"props":910,"children":911},{"style":264},[912],{"type":20,"value":267},{"type":15,"tag":106,"props":914,"children":915},{"style":131},[916],{"type":20,"value":272},{"type":15,"tag":106,"props":918,"children":919},{"style":264},[920],{"type":20,"value":277},{"type":15,"tag":106,"props":922,"children":923},{"style":113},[924],{"type":20,"value":282},{"type":15,"tag":106,"props":926,"children":927},{"style":131},[928],{"type":20,"value":538},{"type":15,"tag":106,"props":930,"children":931},{"style":264},[932],{"type":20,"value":933},"BirthDate",{"type":15,"tag":106,"props":935,"children":936},{"style":131},[937],{"type":20,"value":272},{"type":15,"tag":106,"props":939,"children":940},{"style":264},[941],{"type":20,"value":942},"Value",{"type":15,"tag":106,"props":944,"children":945},{"style":131},[946],{"type":20,"value":272},{"type":15,"tag":106,"props":948,"children":949},{"style":264},[950],{"type":20,"value":277},{"type":15,"tag":106,"props":952,"children":953},{"style":113},[954],{"type":20,"value":282},{"type":15,"tag":106,"props":956,"children":957},{"style":131},[958],{"type":20,"value":300},{"type":15,"tag":106,"props":960,"children":961},{"style":264},[962],{"type":20,"value":267},{"type":15,"tag":106,"props":964,"children":965},{"style":131},[966],{"type":20,"value":272},{"type":15,"tag":106,"props":968,"children":969},{"style":264},[970],{"type":20,"value":313},{"type":15,"tag":106,"props":972,"children":973},{"style":113},[974],{"type":20,"value":318},{"type":15,"tag":106,"props":976,"children":977},{"style":131},[978],{"type":20,"value":538},{"type":15,"tag":106,"props":980,"children":981},{"style":264},[982],{"type":20,"value":933},{"type":15,"tag":106,"props":984,"children":985},{"style":131},[986],{"type":20,"value":272},{"type":15,"tag":106,"props":988,"children":989},{"style":264},[990],{"type":20,"value":942},{"type":15,"tag":106,"props":992,"children":993},{"style":131},[994],{"type":20,"value":272},{"type":15,"tag":106,"props":996,"children":997},{"style":264},[998],{"type":20,"value":313},{"type":15,"tag":106,"props":1000,"children":1001},{"style":131},[1002],{"type":20,"value":408},{"type":15,"tag":106,"props":1004,"children":1005},{"style":113},[1006],{"type":20,"value":1007},"||",{"type":15,"tag":106,"props":1009,"children":1010},{"style":131},[1011],{"type":20,"value":1012}," (DateTime.",{"type":15,"tag":106,"props":1014,"children":1015},{"style":264},[1016],{"type":20,"value":267},{"type":15,"tag":106,"props":1018,"children":1019},{"style":131},[1020],{"type":20,"value":272},{"type":15,"tag":106,"props":1022,"children":1023},{"style":264},[1024],{"type":20,"value":313},{"type":15,"tag":106,"props":1026,"children":1027},{"style":113},[1028],{"type":20,"value":361},{"type":15,"tag":106,"props":1030,"children":1031},{"style":131},[1032],{"type":20,"value":538},{"type":15,"tag":106,"props":1034,"children":1035},{"style":264},[1036],{"type":20,"value":933},{"type":15,"tag":106,"props":1038,"children":1039},{"style":131},[1040],{"type":20,"value":272},{"type":15,"tag":106,"props":1042,"children":1043},{"style":264},[1044],{"type":20,"value":942},{"type":15,"tag":106,"props":1046,"children":1047},{"style":131},[1048],{"type":20,"value":272},{"type":15,"tag":106,"props":1050,"children":1051},{"style":264},[1052],{"type":20,"value":313},{"type":15,"tag":106,"props":1054,"children":1055},{"style":113},[1056],{"type":20,"value":374},{"type":15,"tag":106,"props":1058,"children":1059},{"style":131},[1060],{"type":20,"value":261},{"type":15,"tag":106,"props":1062,"children":1063},{"style":264},[1064],{"type":20,"value":267},{"type":15,"tag":106,"props":1066,"children":1067},{"style":131},[1068],{"type":20,"value":272},{"type":15,"tag":106,"props":1070,"children":1071},{"style":264},[1072],{"type":20,"value":391},{"type":15,"tag":106,"props":1074,"children":1075},{"style":113},[1076],{"type":20,"value":318},{"type":15,"tag":106,"props":1078,"children":1079},{"style":131},[1080],{"type":20,"value":538},{"type":15,"tag":106,"props":1082,"children":1083},{"style":264},[1084],{"type":20,"value":933},{"type":15,"tag":106,"props":1086,"children":1087},{"style":131},[1088],{"type":20,"value":272},{"type":15,"tag":106,"props":1090,"children":1091},{"style":264},[1092],{"type":20,"value":942},{"type":15,"tag":106,"props":1094,"children":1095},{"style":131},[1096],{"type":20,"value":272},{"type":15,"tag":106,"props":1098,"children":1099},{"style":264},[1100],{"type":20,"value":391},{"type":15,"tag":106,"props":1102,"children":1103},{"style":131},[1104],{"type":20,"value":1105},")) ",{"type":15,"tag":106,"props":1107,"children":1108},{"style":113},[1109],{"type":20,"value":413},{"type":15,"tag":106,"props":1111,"children":1112},{"style":416},[1113],{"type":20,"value":419},{"type":15,"tag":106,"props":1115,"children":1116},{"style":113},[1117],{"type":20,"value":424},{"type":15,"tag":106,"props":1119,"children":1120},{"style":416},[1121],{"type":20,"value":429},{"type":15,"tag":106,"props":1123,"children":1124},{"style":131},[1125],{"type":20,"value":1126},")));\n",{"type":15,"tag":106,"props":1128,"children":1129},{"class":108,"line":225},[1130],{"type":15,"tag":106,"props":1131,"children":1132},{"emptyLinePlaceholder":219},[1133],{"type":20,"value":222},{"type":15,"tag":106,"props":1135,"children":1136},{"class":108,"line":243},[1137,1141,1145],{"type":15,"tag":106,"props":1138,"children":1139},{"style":113},[1140],{"type":20,"value":143},{"type":15,"tag":106,"props":1142,"children":1143},{"style":146},[1144],{"type":20,"value":149},{"type":15,"tag":106,"props":1146,"children":1147},{"style":131},[1148],{"type":20,"value":154},{"type":15,"tag":106,"props":1150,"children":1151},{"class":108,"line":334},[1152,1156,1160,1164,1169,1174,1178,1184],{"type":15,"tag":106,"props":1153,"children":1154},{"style":146},[1155],{"type":20,"value":163},{"type":15,"tag":106,"props":1157,"children":1158},{"style":131},[1159],{"type":20,"value":168},{"type":15,"tag":106,"props":1161,"children":1162},{"style":119},[1163],{"type":20,"value":173},{"type":15,"tag":106,"props":1165,"children":1166},{"style":131},[1167],{"type":20,"value":1168}," fullNameExpression.",{"type":15,"tag":106,"props":1170,"children":1171},{"style":504},[1172],{"type":20,"value":1173},"Evaluate",{"type":15,"tag":106,"props":1175,"children":1176},{"style":131},[1177],{"type":20,"value":522},{"type":15,"tag":106,"props":1179,"children":1181},{"style":1180},"--shiki-default:#DF69BA;--shiki-default-font-style:inherit;--shiki-dark:#BD93F9;--shiki-dark-font-style:italic",[1182],{"type":20,"value":1183},"this",{"type":15,"tag":106,"props":1185,"children":1186},{"style":131},[1187],{"type":20,"value":1188},"); }\n",{"type":15,"tag":106,"props":1190,"children":1191},{"class":108,"line":437},[1192],{"type":15,"tag":106,"props":1193,"children":1194},{"style":131},[1195],{"type":20,"value":212},{"type":15,"tag":106,"props":1197,"children":1198},{"class":108,"line":446},[1199],{"type":15,"tag":106,"props":1200,"children":1201},{"emptyLinePlaceholder":219},[1202],{"type":20,"value":222},{"type":15,"tag":106,"props":1204,"children":1205},{"class":108,"line":454},[1206,1210,1214],{"type":15,"tag":106,"props":1207,"children":1208},{"style":113},[1209],{"type":20,"value":143},{"type":15,"tag":106,"props":1211,"children":1212},{"style":146},[1213],{"type":20,"value":235},{"type":15,"tag":106,"props":1215,"children":1216},{"style":131},[1217],{"type":20,"value":240},{"type":15,"tag":106,"props":1219,"children":1220},{"class":108,"line":463},[1221,1225,1229,1233,1238,1242,1246,1250],{"type":15,"tag":106,"props":1222,"children":1223},{"style":146},[1224],{"type":20,"value":163},{"type":15,"tag":106,"props":1226,"children":1227},{"style":131},[1228],{"type":20,"value":168},{"type":15,"tag":106,"props":1230,"children":1231},{"style":119},[1232],{"type":20,"value":173},{"type":15,"tag":106,"props":1234,"children":1235},{"style":131},[1236],{"type":20,"value":1237}," ageExpression.",{"type":15,"tag":106,"props":1239,"children":1240},{"style":504},[1241],{"type":20,"value":1173},{"type":15,"tag":106,"props":1243,"children":1244},{"style":131},[1245],{"type":20,"value":522},{"type":15,"tag":106,"props":1247,"children":1248},{"style":1180},[1249],{"type":20,"value":1183},{"type":15,"tag":106,"props":1251,"children":1252},{"style":131},[1253],{"type":20,"value":1188},{"type":15,"tag":106,"props":1255,"children":1256},{"class":108,"line":471},[1257],{"type":15,"tag":106,"props":1258,"children":1259},{"style":131},[1260],{"type":20,"value":212},{"type":15,"tag":106,"props":1262,"children":1264},{"class":108,"line":1263},14,[1265],{"type":15,"tag":106,"props":1266,"children":1267},{"style":131},[1268],{"type":20,"value":460},{"type":15,"tag":106,"props":1270,"children":1272},{"class":108,"line":1271},15,[1273],{"type":15,"tag":106,"props":1274,"children":1275},{"emptyLinePlaceholder":219},[1276],{"type":20,"value":222},{"type":15,"tag":106,"props":1278,"children":1280},{"class":108,"line":1279},16,[1281,1285,1289,1293,1297,1301,1305,1309,1313,1317,1321,1325,1329,1333,1337,1341,1345,1349,1353,1357,1361,1365,1369,1373,1377,1381,1385,1390],{"type":15,"tag":106,"props":1282,"children":1283},{"style":146},[1284],{"type":20,"value":477},{"type":15,"tag":106,"props":1286,"children":1287},{"style":131},[1288],{"type":20,"value":482},{"type":15,"tag":106,"props":1290,"children":1291},{"style":113},[1292],{"type":20,"value":487},{"type":15,"tag":106,"props":1294,"children":1295},{"style":131},[1296],{"type":20,"value":492},{"type":15,"tag":106,"props":1298,"children":1299},{"style":264},[1300],{"type":20,"value":497},{"type":15,"tag":106,"props":1302,"children":1303},{"style":131},[1304],{"type":20,"value":272},{"type":15,"tag":106,"props":1306,"children":1307},{"style":504},[1308],{"type":20,"value":517},{"type":15,"tag":106,"props":1310,"children":1311},{"style":131},[1312],{"type":20,"value":522},{"type":15,"tag":106,"props":1314,"children":1315},{"style":525},[1316],{"type":20,"value":528},{"type":15,"tag":106,"props":1318,"children":1319},{"style":113},[1320],{"type":20,"value":533},{"type":15,"tag":106,"props":1322,"children":1323},{"style":131},[1324],{"type":20,"value":538},{"type":15,"tag":106,"props":1326,"children":1327},{"style":264},[1328],{"type":20,"value":543},{"type":15,"tag":106,"props":1330,"children":1331},{"style":131},[1332],{"type":20,"value":272},{"type":15,"tag":106,"props":1334,"children":1335},{"style":504},[1336],{"type":20,"value":552},{"type":15,"tag":106,"props":1338,"children":1339},{"style":131},[1340],{"type":20,"value":522},{"type":15,"tag":106,"props":1342,"children":1343},{"style":186},[1344],{"type":20,"value":561},{"type":15,"tag":106,"props":1346,"children":1347},{"style":564},[1348],{"type":20,"value":567},{"type":15,"tag":106,"props":1350,"children":1351},{"style":186},[1352],{"type":20,"value":561},{"type":15,"tag":106,"props":1354,"children":1355},{"style":131},[1356],{"type":20,"value":576},{"type":15,"tag":106,"props":1358,"children":1359},{"style":504},[1360],{"type":20,"value":581},{"type":15,"tag":106,"props":1362,"children":1363},{"style":131},[1364],{"type":20,"value":522},{"type":15,"tag":106,"props":1366,"children":1367},{"style":525},[1368],{"type":20,"value":528},{"type":15,"tag":106,"props":1370,"children":1371},{"style":113},[1372],{"type":20,"value":533},{"type":15,"tag":106,"props":1374,"children":1375},{"style":131},[1376],{"type":20,"value":538},{"type":15,"tag":106,"props":1378,"children":1379},{"style":264},[1380],{"type":20,"value":602},{"type":15,"tag":106,"props":1382,"children":1383},{"style":131},[1384],{"type":20,"value":745},{"type":15,"tag":106,"props":1386,"children":1387},{"style":504},[1388],{"type":20,"value":1389},"WithTranslations",{"type":15,"tag":106,"props":1391,"children":1392},{"style":131},[1393],{"type":20,"value":1394},"();\n",{"type":15,"tag":82,"props":1396,"children":1398},{"id":1397},"getting-started",[1399],{"type":20,"value":1400},"Getting started",{"type":15,"tag":50,"props":1402,"children":1403},{},[1404],{"type":15,"tag":16,"props":1405,"children":1406},{},[1407,1413,1415],{"type":15,"tag":41,"props":1408,"children":1410},{"href":1409},"https://www.nuget.org/packages/Microsoft.Linq.Translations",[1411],{"type":20,"value":1412},"Binaries at NuGet",{"type":20,"value":1414}," or ",{"type":15,"tag":41,"props":1416,"children":1418},{"href":1417},"https://github.com/damieng/Linq.Translations",[1419],{"type":20,"value":1420},"Source on GitHub",{"type":15,"tag":82,"props":1422,"children":1424},{"id":1423},"usage-considerations",[1425],{"type":20,"value":1426},"Usage considerations",{"type":15,"tag":16,"props":1428,"children":1429},{},[1430],{"type":20,"value":1431},"The caveats to the technique shown above are:",{"type":15,"tag":1433,"props":1434,"children":1435},"ul",{},[1436,1442],{"type":15,"tag":1437,"props":1438,"children":1439},"li",{},[1440],{"type":20,"value":1441},"You need to ensure your class is initialized before you write queries with it (see alternatives below).",{"type":15,"tag":1437,"props":1443,"children":1444},{},[1445],{"type":20,"value":1446},"The expression you register for a property must be translatable to the remote store. You need to constrain yourself to the methods and operators your IQueryable provider supports.",{"type":15,"tag":16,"props":1448,"children":1449},{},[1450],{"type":20,"value":1451},"There are a few alternative ways to use this rather than the specific examples above.",{"type":15,"tag":1453,"props":1454,"children":1456},"h3",{"id":1455},"registering-the-expressions",[1457],{"type":20,"value":1458},"Registering the expressions",{"type":15,"tag":16,"props":1460,"children":1461},{},[1462],{"type":20,"value":1463},"You can register the properties in the class itself, as shown in the examples. This means the properties themselves can evaluate the expressions without any reflection calls. Alternatively, if performance is less critical, you can register them elsewhere and have the methods look up their values dynamically via reflection. e.g.",{"type":15,"tag":94,"props":1465,"children":1467},{"className":96,"code":1466,"language":98,"meta":99,"style":99},"DefaultTranslationOf\u003CEmployee>.Property(e => e.FullName).Is(e => e.Forename + \" \" + e.Surname);\nvar employees = db.Employees.Where(e => e.FullName.Contains(\"da\")).GroupBy(e => e.Age).WithTranslations();\n\npartial class Employee {\n    public string FullName { get { return DefaultTranslationOf\u003CEmployees>.Evaluate\u003Cstring>(this, MethodInfo.GetCurrentMethod());} }\n}\n",[1468],{"type":15,"tag":102,"props":1469,"children":1470},{"__ignoreMap":99},[1471,1567,1682,1689,1708,1786],{"type":15,"tag":106,"props":1472,"children":1473},{"class":108,"line":109},[1474,1479,1483,1487,1491,1495,1499,1503,1507,1511,1515,1519,1523,1527,1531,1535,1539,1543,1547,1551,1555,1559,1563],{"type":15,"tag":106,"props":1475,"children":1476},{"style":131},[1477],{"type":20,"value":1478},"DefaultTranslationOf\u003C",{"type":15,"tag":106,"props":1480,"children":1481},{"style":665},[1482],{"type":20,"value":678},{"type":15,"tag":106,"props":1484,"children":1485},{"style":131},[1486],{"type":20,"value":715},{"type":15,"tag":106,"props":1488,"children":1489},{"style":504},[1490],{"type":20,"value":720},{"type":15,"tag":106,"props":1492,"children":1493},{"style":131},[1494],{"type":20,"value":522},{"type":15,"tag":106,"props":1496,"children":1497},{"style":525},[1498],{"type":20,"value":528},{"type":15,"tag":106,"props":1500,"children":1501},{"style":113},[1502],{"type":20,"value":533},{"type":15,"tag":106,"props":1504,"children":1505},{"style":131},[1506],{"type":20,"value":538},{"type":15,"tag":106,"props":1508,"children":1509},{"style":264},[1510],{"type":20,"value":543},{"type":15,"tag":106,"props":1512,"children":1513},{"style":131},[1514],{"type":20,"value":745},{"type":15,"tag":106,"props":1516,"children":1517},{"style":504},[1518],{"type":20,"value":750},{"type":15,"tag":106,"props":1520,"children":1521},{"style":131},[1522],{"type":20,"value":522},{"type":15,"tag":106,"props":1524,"children":1525},{"style":525},[1526],{"type":20,"value":528},{"type":15,"tag":106,"props":1528,"children":1529},{"style":113},[1530],{"type":20,"value":533},{"type":15,"tag":106,"props":1532,"children":1533},{"style":131},[1534],{"type":20,"value":538},{"type":15,"tag":106,"props":1536,"children":1537},{"style":264},[1538],{"type":20,"value":771},{"type":15,"tag":106,"props":1540,"children":1541},{"style":113},[1542],{"type":20,"value":198},{"type":15,"tag":106,"props":1544,"children":1545},{"style":186},[1546],{"type":20,"value":189},{"type":15,"tag":106,"props":1548,"children":1549},{"style":186},[1550],{"type":20,"value":189},{"type":15,"tag":106,"props":1552,"children":1553},{"style":113},[1554],{"type":20,"value":198},{"type":15,"tag":106,"props":1556,"children":1557},{"style":131},[1558],{"type":20,"value":538},{"type":15,"tag":106,"props":1560,"children":1561},{"style":264},[1562],{"type":20,"value":796},{"type":15,"tag":106,"props":1564,"children":1565},{"style":131},[1566],{"type":20,"value":607},{"type":15,"tag":106,"props":1568,"children":1569},{"class":108,"line":137},[1570,1574,1578,1582,1586,1590,1594,1598,1602,1606,1610,1614,1618,1622,1626,1630,1634,1638,1642,1646,1650,1654,1658,1662,1666,1670,1674,1678],{"type":15,"tag":106,"props":1571,"children":1572},{"style":146},[1573],{"type":20,"value":477},{"type":15,"tag":106,"props":1575,"children":1576},{"style":131},[1577],{"type":20,"value":482},{"type":15,"tag":106,"props":1579,"children":1580},{"style":113},[1581],{"type":20,"value":487},{"type":15,"tag":106,"props":1583,"children":1584},{"style":131},[1585],{"type":20,"value":492},{"type":15,"tag":106,"props":1587,"children":1588},{"style":264},[1589],{"type":20,"value":497},{"type":15,"tag":106,"props":1591,"children":1592},{"style":131},[1593],{"type":20,"value":272},{"type":15,"tag":106,"props":1595,"children":1596},{"style":504},[1597],{"type":20,"value":517},{"type":15,"tag":106,"props":1599,"children":1600},{"style":131},[1601],{"type":20,"value":522},{"type":15,"tag":106,"props":1603,"children":1604},{"style":525},[1605],{"type":20,"value":528},{"type":15,"tag":106,"props":1607,"children":1608},{"style":113},[1609],{"type":20,"value":533},{"type":15,"tag":106,"props":1611,"children":1612},{"style":131},[1613],{"type":20,"value":538},{"type":15,"tag":106,"props":1615,"children":1616},{"style":264},[1617],{"type":20,"value":543},{"type":15,"tag":106,"props":1619,"children":1620},{"style":131},[1621],{"type":20,"value":272},{"type":15,"tag":106,"props":1623,"children":1624},{"style":504},[1625],{"type":20,"value":552},{"type":15,"tag":106,"props":1627,"children":1628},{"style":131},[1629],{"type":20,"value":522},{"type":15,"tag":106,"props":1631,"children":1632},{"style":186},[1633],{"type":20,"value":561},{"type":15,"tag":106,"props":1635,"children":1636},{"style":564},[1637],{"type":20,"value":567},{"type":15,"tag":106,"props":1639,"children":1640},{"style":186},[1641],{"type":20,"value":561},{"type":15,"tag":106,"props":1643,"children":1644},{"style":131},[1645],{"type":20,"value":576},{"type":15,"tag":106,"props":1647,"children":1648},{"style":504},[1649],{"type":20,"value":581},{"type":15,"tag":106,"props":1651,"children":1652},{"style":131},[1653],{"type":20,"value":522},{"type":15,"tag":106,"props":1655,"children":1656},{"style":525},[1657],{"type":20,"value":528},{"type":15,"tag":106,"props":1659,"children":1660},{"style":113},[1661],{"type":20,"value":533},{"type":15,"tag":106,"props":1663,"children":1664},{"style":131},[1665],{"type":20,"value":538},{"type":15,"tag":106,"props":1667,"children":1668},{"style":264},[1669],{"type":20,"value":602},{"type":15,"tag":106,"props":1671,"children":1672},{"style":131},[1673],{"type":20,"value":745},{"type":15,"tag":106,"props":1675,"children":1676},{"style":504},[1677],{"type":20,"value":1389},{"type":15,"tag":106,"props":1679,"children":1680},{"style":131},[1681],{"type":20,"value":1394},{"type":15,"tag":106,"props":1683,"children":1684},{"class":108,"line":157},[1685],{"type":15,"tag":106,"props":1686,"children":1687},{"emptyLinePlaceholder":219},[1688],{"type":20,"value":222},{"type":15,"tag":106,"props":1690,"children":1691},{"class":108,"line":206},[1692,1696,1700,1704],{"type":15,"tag":106,"props":1693,"children":1694},{"style":113},[1695],{"type":20,"value":116},{"type":15,"tag":106,"props":1697,"children":1698},{"style":119},[1699],{"type":20,"value":122},{"type":15,"tag":106,"props":1701,"children":1702},{"style":125},[1703],{"type":20,"value":128},{"type":15,"tag":106,"props":1705,"children":1706},{"style":131},[1707],{"type":20,"value":134},{"type":15,"tag":106,"props":1709,"children":1710},{"class":108,"line":215},[1711,1716,1720,1725,1730,1734,1738,1742,1746,1750,1754,1758,1762,1767,1771,1776,1781],{"type":15,"tag":106,"props":1712,"children":1713},{"style":113},[1714],{"type":20,"value":1715},"    public",{"type":15,"tag":106,"props":1717,"children":1718},{"style":146},[1719],{"type":20,"value":149},{"type":15,"tag":106,"props":1721,"children":1722},{"style":131},[1723],{"type":20,"value":1724}," FullName { ",{"type":15,"tag":106,"props":1726,"children":1727},{"style":146},[1728],{"type":20,"value":1729},"get",{"type":15,"tag":106,"props":1731,"children":1732},{"style":131},[1733],{"type":20,"value":168},{"type":15,"tag":106,"props":1735,"children":1736},{"style":119},[1737],{"type":20,"value":173},{"type":15,"tag":106,"props":1739,"children":1740},{"style":131},[1741],{"type":20,"value":706},{"type":15,"tag":106,"props":1743,"children":1744},{"style":665},[1745],{"type":20,"value":497},{"type":15,"tag":106,"props":1747,"children":1748},{"style":131},[1749],{"type":20,"value":715},{"type":15,"tag":106,"props":1751,"children":1752},{"style":504},[1753],{"type":20,"value":1173},{"type":15,"tag":106,"props":1755,"children":1756},{"style":131},[1757],{"type":20,"value":673},{"type":15,"tag":106,"props":1759,"children":1760},{"style":146},[1761],{"type":20,"value":688},{"type":15,"tag":106,"props":1763,"children":1764},{"style":131},[1765],{"type":20,"value":1766},">(",{"type":15,"tag":106,"props":1768,"children":1769},{"style":1180},[1770],{"type":20,"value":1183},{"type":15,"tag":106,"props":1772,"children":1773},{"style":131},[1774],{"type":20,"value":1775},", MethodInfo.",{"type":15,"tag":106,"props":1777,"children":1778},{"style":504},[1779],{"type":20,"value":1780},"GetCurrentMethod",{"type":15,"tag":106,"props":1782,"children":1783},{"style":131},[1784],{"type":20,"value":1785},"());} }\n",{"type":15,"tag":106,"props":1787,"children":1788},{"class":108,"line":225},[1789],{"type":15,"tag":106,"props":1790,"children":1791},{"style":131},[1792],{"type":20,"value":460},{"type":15,"tag":16,"props":1794,"children":1795},{},[1796],{"type":20,"value":1797},"When the performance of these client-side properties is critical, you can have them as regular get properties with the full code in there at the expense of having the calculation duplicated, once in IL in the property and once as an expression for the translation.",{"type":15,"tag":1453,"props":1799,"children":1801},{"id":1800},"different-maps-for-different-scenarios",[1802],{"type":20,"value":1803},"Different maps for different scenarios",{"type":15,"tag":16,"props":1805,"children":1806},{},[1807],{"type":20,"value":1808},"Sometimes certain parts of your application may want to run with different translations for different scenarios, performance etc. No problem!",{"type":15,"tag":16,"props":1810,"children":1811},{},[1812],{"type":20,"value":1813},"The WithTranslations method normally operates against the default translation map (accessed with DefaultTranslationOf), but there is also another overload that takes a TranslationMap you can build for specific scenarios, e.g.",{"type":15,"tag":94,"props":1815,"children":1817},{"className":96,"code":1816,"language":98,"meta":99,"style":99},"var myTranslationMap = new TranslationMap();\nmyTranslationMap.Add\u003CEmployees, string>(e => e.Name, e => e.FirstName + \" \" + e.LastName);\nvar results = (from e in db.Employees where e.Name.Contains(\"martin\") select e).WithTranslations(myTranslationMap).ToList();\n",[1818],{"type":15,"tag":102,"props":1819,"children":1820},{"__ignoreMap":99},[1821,1851,1952],{"type":15,"tag":106,"props":1822,"children":1823},{"class":108,"line":109},[1824,1828,1833,1837,1842,1847],{"type":15,"tag":106,"props":1825,"children":1826},{"style":146},[1827],{"type":20,"value":477},{"type":15,"tag":106,"props":1829,"children":1830},{"style":131},[1831],{"type":20,"value":1832}," myTranslationMap ",{"type":15,"tag":106,"props":1834,"children":1835},{"style":113},[1836],{"type":20,"value":487},{"type":15,"tag":106,"props":1838,"children":1839},{"style":119},[1840],{"type":20,"value":1841}," new",{"type":15,"tag":106,"props":1843,"children":1844},{"style":665},[1845],{"type":20,"value":1846}," TranslationMap",{"type":15,"tag":106,"props":1848,"children":1849},{"style":131},[1850],{"type":20,"value":1394},{"type":15,"tag":106,"props":1852,"children":1853},{"class":108,"line":137},[1854,1859,1864,1868,1872,1877,1881,1885,1889,1893,1897,1902,1906,1910,1914,1918,1923,1927,1931,1935,1939,1943,1948],{"type":15,"tag":106,"props":1855,"children":1856},{"style":131},[1857],{"type":20,"value":1858},"myTranslationMap.",{"type":15,"tag":106,"props":1860,"children":1861},{"style":504},[1862],{"type":20,"value":1863},"Add",{"type":15,"tag":106,"props":1865,"children":1866},{"style":131},[1867],{"type":20,"value":673},{"type":15,"tag":106,"props":1869,"children":1870},{"style":665},[1871],{"type":20,"value":497},{"type":15,"tag":106,"props":1873,"children":1874},{"style":131},[1875],{"type":20,"value":1876},", ",{"type":15,"tag":106,"props":1878,"children":1879},{"style":146},[1880],{"type":20,"value":688},{"type":15,"tag":106,"props":1882,"children":1883},{"style":131},[1884],{"type":20,"value":1766},{"type":15,"tag":106,"props":1886,"children":1887},{"style":525},[1888],{"type":20,"value":528},{"type":15,"tag":106,"props":1890,"children":1891},{"style":113},[1892],{"type":20,"value":533},{"type":15,"tag":106,"props":1894,"children":1895},{"style":131},[1896],{"type":20,"value":538},{"type":15,"tag":106,"props":1898,"children":1899},{"style":264},[1900],{"type":20,"value":1901},"Name",{"type":15,"tag":106,"props":1903,"children":1904},{"style":131},[1905],{"type":20,"value":1876},{"type":15,"tag":106,"props":1907,"children":1908},{"style":525},[1909],{"type":20,"value":528},{"type":15,"tag":106,"props":1911,"children":1912},{"style":113},[1913],{"type":20,"value":533},{"type":15,"tag":106,"props":1915,"children":1916},{"style":131},[1917],{"type":20,"value":538},{"type":15,"tag":106,"props":1919,"children":1920},{"style":264},[1921],{"type":20,"value":1922},"FirstName",{"type":15,"tag":106,"props":1924,"children":1925},{"style":113},[1926],{"type":20,"value":198},{"type":15,"tag":106,"props":1928,"children":1929},{"style":186},[1930],{"type":20,"value":189},{"type":15,"tag":106,"props":1932,"children":1933},{"style":186},[1934],{"type":20,"value":189},{"type":15,"tag":106,"props":1936,"children":1937},{"style":113},[1938],{"type":20,"value":198},{"type":15,"tag":106,"props":1940,"children":1941},{"style":131},[1942],{"type":20,"value":538},{"type":15,"tag":106,"props":1944,"children":1945},{"style":264},[1946],{"type":20,"value":1947},"LastName",{"type":15,"tag":106,"props":1949,"children":1950},{"style":131},[1951],{"type":20,"value":607},{"type":15,"tag":106,"props":1953,"children":1954},{"class":108,"line":157},[1955,1959,1964,1968,1973,1978,1983,1988,1992,1996,2001,2005,2009,2013,2017,2021,2025,2030,2034,2038,2043,2048,2052,2057,2061],{"type":15,"tag":106,"props":1956,"children":1957},{"style":146},[1958],{"type":20,"value":477},{"type":15,"tag":106,"props":1960,"children":1961},{"style":131},[1962],{"type":20,"value":1963}," results ",{"type":15,"tag":106,"props":1965,"children":1966},{"style":113},[1967],{"type":20,"value":487},{"type":15,"tag":106,"props":1969,"children":1970},{"style":131},[1971],{"type":20,"value":1972}," (",{"type":15,"tag":106,"props":1974,"children":1975},{"style":119},[1976],{"type":20,"value":1977},"from",{"type":15,"tag":106,"props":1979,"children":1980},{"style":131},[1981],{"type":20,"value":1982}," e ",{"type":15,"tag":106,"props":1984,"children":1985},{"style":119},[1986],{"type":20,"value":1987},"in",{"type":15,"tag":106,"props":1989,"children":1990},{"style":131},[1991],{"type":20,"value":492},{"type":15,"tag":106,"props":1993,"children":1994},{"style":264},[1995],{"type":20,"value":497},{"type":15,"tag":106,"props":1997,"children":1998},{"style":119},[1999],{"type":20,"value":2000}," where",{"type":15,"tag":106,"props":2002,"children":2003},{"style":131},[2004],{"type":20,"value":538},{"type":15,"tag":106,"props":2006,"children":2007},{"style":264},[2008],{"type":20,"value":1901},{"type":15,"tag":106,"props":2010,"children":2011},{"style":131},[2012],{"type":20,"value":272},{"type":15,"tag":106,"props":2014,"children":2015},{"style":504},[2016],{"type":20,"value":552},{"type":15,"tag":106,"props":2018,"children":2019},{"style":131},[2020],{"type":20,"value":522},{"type":15,"tag":106,"props":2022,"children":2023},{"style":186},[2024],{"type":20,"value":561},{"type":15,"tag":106,"props":2026,"children":2027},{"style":564},[2028],{"type":20,"value":2029},"martin",{"type":15,"tag":106,"props":2031,"children":2032},{"style":186},[2033],{"type":20,"value":561},{"type":15,"tag":106,"props":2035,"children":2036},{"style":131},[2037],{"type":20,"value":408},{"type":15,"tag":106,"props":2039,"children":2040},{"style":119},[2041],{"type":20,"value":2042},"select",{"type":15,"tag":106,"props":2044,"children":2045},{"style":131},[2046],{"type":20,"value":2047}," e).",{"type":15,"tag":106,"props":2049,"children":2050},{"style":504},[2051],{"type":20,"value":1389},{"type":15,"tag":106,"props":2053,"children":2054},{"style":131},[2055],{"type":20,"value":2056},"(myTranslationMap).",{"type":15,"tag":106,"props":2058,"children":2059},{"style":504},[2060],{"type":20,"value":507},{"type":15,"tag":106,"props":2062,"children":2063},{"style":131},[2064],{"type":20,"value":1394},{"type":15,"tag":82,"props":2066,"children":2068},{"id":2067},"how-it-works",[2069],{"type":20,"value":2070},"How it works",{"type":15,"tag":1453,"props":2072,"children":2074},{"id":2073},"compiledexpressiont-tresult",[2075],{"type":20,"value":2076},"CompiledExpression\u003CT, TResult>",{"type":15,"tag":16,"props":2078,"children":2079},{},[2080],{"type":20,"value":2081},"The first thing we needed to do was get the user-written client-side “computed” properties out of IL and back into expression trees so we could translate them. Given we also want to evaluate them on the client, we need to compile them at run time, so CompiledExpression exists. It takes an expression of Func\u003CT, TResult>, compiles it, and allows evaluation of objects against the compiled version.",{"type":15,"tag":1453,"props":2083,"children":2085},{"id":2084},"expressiveextensions",[2086],{"type":20,"value":2087},"ExpressiveExtensions",{"type":15,"tag":16,"props":2089,"children":2090},{},[2091],{"type":20,"value":2092},"This little class provides both the WithTranslations extensions methods and the internal TranslatingVisitor that unravels the property accesses into their actual, registered Func\u003CT, TResult> expressions via the TranslationMap so that the underlying LINQ provider can deal with that instead.",{"type":15,"tag":1453,"props":2094,"children":2096},{"id":2095},"translationmap",[2097],{"type":20,"value":2098},"TranslationMap",{"type":15,"tag":16,"props":2100,"children":2101},{},[2102],{"type":20,"value":2103},"We need to have a map of properties to compiled expressions, and for that purpose, TranslationMap exists. You can create a TranslationMap by hand and pass it to WithTranslations if you want to programmatically create them at run-time or have different ones for different scenarios, but generally, you will want to use DefaultTranslationOf.",{"type":15,"tag":1453,"props":2105,"children":2107},{"id":2106},"defaulttranslationof",[2108],{"type":20,"value":2109},"DefaultTranslationOf",{"type":15,"tag":16,"props":2111,"children":2112},{},[2113],{"type":20,"value":2114},"This helper class lets you register properties against the default TranslationMap we use when nothing is passed to WithTranslations. It also allows you to look-up what is already registered so you can evaluate that although there is a small reflection performance penalty:",{"type":15,"tag":94,"props":2116,"children":2118},{"className":96,"code":2117,"language":98,"meta":99,"style":99},"public int Age { get { return DefaultTranslationOf\u003CEmployees>.Evaluate\u003Cint>(this, MethodInfo.GetCurrentMethod()); } }\n",[2119],{"type":15,"tag":102,"props":2120,"children":2121},{"__ignoreMap":99},[2122],{"type":15,"tag":106,"props":2123,"children":2124},{"class":108,"line":109},[2125,2130,2134,2139,2143,2147,2151,2155,2159,2163,2167,2171,2175,2179,2183],{"type":15,"tag":106,"props":2126,"children":2127},{"style":113},[2128],{"type":20,"value":2129},"public",{"type":15,"tag":106,"props":2131,"children":2132},{"style":146},[2133],{"type":20,"value":235},{"type":15,"tag":106,"props":2135,"children":2136},{"style":131},[2137],{"type":20,"value":2138}," Age { get { ",{"type":15,"tag":106,"props":2140,"children":2141},{"style":119},[2142],{"type":20,"value":173},{"type":15,"tag":106,"props":2144,"children":2145},{"style":131},[2146],{"type":20,"value":706},{"type":15,"tag":106,"props":2148,"children":2149},{"style":665},[2150],{"type":20,"value":497},{"type":15,"tag":106,"props":2152,"children":2153},{"style":131},[2154],{"type":20,"value":715},{"type":15,"tag":106,"props":2156,"children":2157},{"style":504},[2158],{"type":20,"value":1173},{"type":15,"tag":106,"props":2160,"children":2161},{"style":131},[2162],{"type":20,"value":673},{"type":15,"tag":106,"props":2164,"children":2165},{"style":146},[2166],{"type":20,"value":836},{"type":15,"tag":106,"props":2168,"children":2169},{"style":131},[2170],{"type":20,"value":1766},{"type":15,"tag":106,"props":2172,"children":2173},{"style":1180},[2174],{"type":20,"value":1183},{"type":15,"tag":106,"props":2176,"children":2177},{"style":131},[2178],{"type":20,"value":1775},{"type":15,"tag":106,"props":2180,"children":2181},{"style":504},[2182],{"type":20,"value":1780},{"type":15,"tag":106,"props":2184,"children":2185},{"style":131},[2186],{"type":20,"value":2187},"()); } }\n",{"type":15,"tag":16,"props":2189,"children":2190},{},[2191],{"type":20,"value":2192},"Have fun!",{"type":15,"tag":16,"props":2194,"children":2195},{},[2196],{"type":15,"tag":2197,"props":2198,"children":2199},"em",{},[2200],{"type":20,"value":2201},"[)amien",{"type":15,"tag":2203,"props":2204,"children":2205},"style",{},[2206],{"type":20,"value":2207},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":99,"searchDepth":137,"depth":137,"links":2209},[2210,2211,2212,2213,2217],{"id":84,"depth":137,"text":87},{"id":610,"depth":137,"text":613},{"id":1397,"depth":137,"text":1400},{"id":1423,"depth":137,"text":1426,"children":2214},[2215,2216],{"id":1455,"depth":157,"text":1458},{"id":1800,"depth":157,"text":1803},{"id":2067,"depth":137,"text":2070,"children":2218},[2219,2220,2221,2222],{"id":2073,"depth":157,"text":2076},{"id":2084,"depth":157,"text":2087},{"id":2095,"depth":157,"text":2098},{"id":2106,"depth":157,"text":2109},"markdown","content:blog:2009:client-side-properties-and-any-remote-linq-provider.md","content","blog/2009/client-side-properties-and-any-remote-linq-provider.md","blog/2009/client-side-properties-and-any-remote-linq-provider","md","/blog/2009/client-side-properties-and-any-remote-linq-provider/",1181,43,[2233,2237,2241],{"title":2234,"date":2235,"url":2236},"HTML5 Video Cheatsheet: Optimizing videos for the web","2025-12-05T00:00:00Z","/blog/2025/html5-video-cheatsheet/",{"title":2238,"date":2239,"url":2240},"Transactions in the MongoDB EF Core Provider","2025-10-25","/blog/2025/mongodb-explicit-transactions/",{"title":2242,"date":2243,"url":2244},"Queryable Encryption with the MongoDB EF Core Provider","2025-09-22","/blog/2025/mongodb-queryable-encryption/",[2246,2346,2366,2387,2997,3027,3062,3084,3124,3141,3163,3185,3215,3232,3252,3274,3294,3728,3753,4272,4307,4985,5006,5026,5043,5182,5199,5226,5243,5262,5287,5314,5779,5970,6018,6038,6063,6080,6106,6131,6153,6173],{"_path":2247,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":2249,"description":2250,"id":2249,"date":2251,"name":2252,"avatar":2253,"body":2254,"_type":2223,"_id":2343,"_source":2225,"_file":2344,"_stem":2345,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/00430b4b","client-side-properties-and-any-remote-linq-provider","00430b4b","There is any way to include the property without including in where ?","2018-08-09T09:03:02.8960027Z","Max","https://github.com/m4ss1m0g",{"type":12,"children":2255,"toc":2341},[2256,2260,2265,2332,2337],{"type":15,"tag":16,"props":2257,"children":2258},{},[2259],{"type":20,"value":2250},{"type":15,"tag":16,"props":2261,"children":2262},{},[2263],{"type":20,"value":2264},"Something like that:",{"type":15,"tag":94,"props":2266,"children":2268},{"className":96,"code":2267,"language":98,"meta":99,"style":99},"var result = context.Employee.Include(p=> p.FullName)\n",[2269],{"type":15,"tag":102,"props":2270,"children":2271},{"__ignoreMap":99},[2272],{"type":15,"tag":106,"props":2273,"children":2274},{"class":108,"line":109},[2275,2279,2284,2288,2293,2297,2301,2306,2310,2314,2319,2324,2328],{"type":15,"tag":106,"props":2276,"children":2277},{"style":146},[2278],{"type":20,"value":477},{"type":15,"tag":106,"props":2280,"children":2281},{"style":131},[2282],{"type":20,"value":2283}," result ",{"type":15,"tag":106,"props":2285,"children":2286},{"style":113},[2287],{"type":20,"value":487},{"type":15,"tag":106,"props":2289,"children":2290},{"style":131},[2291],{"type":20,"value":2292}," context.",{"type":15,"tag":106,"props":2294,"children":2295},{"style":264},[2296],{"type":20,"value":678},{"type":15,"tag":106,"props":2298,"children":2299},{"style":131},[2300],{"type":20,"value":272},{"type":15,"tag":106,"props":2302,"children":2303},{"style":504},[2304],{"type":20,"value":2305},"Include",{"type":15,"tag":106,"props":2307,"children":2308},{"style":131},[2309],{"type":20,"value":522},{"type":15,"tag":106,"props":2311,"children":2312},{"style":525},[2313],{"type":20,"value":16},{"type":15,"tag":106,"props":2315,"children":2316},{"style":113},[2317],{"type":20,"value":2318},"=>",{"type":15,"tag":106,"props":2320,"children":2321},{"style":131},[2322],{"type":20,"value":2323}," p.",{"type":15,"tag":106,"props":2325,"children":2326},{"style":264},[2327],{"type":20,"value":543},{"type":15,"tag":106,"props":2329,"children":2330},{"style":131},[2331],{"type":20,"value":331},{"type":15,"tag":16,"props":2333,"children":2334},{},[2335],{"type":20,"value":2336},"Otherwise for getting the FullName value I must include it on where clause",{"type":15,"tag":2203,"props":2338,"children":2339},{},[2340],{"type":20,"value":2207},{"title":99,"searchDepth":137,"depth":137,"links":2342},[],"content:comments:client-side-properties-and-any-remote-linq-provider:00430b4b.md","comments/client-side-properties-and-any-remote-linq-provider/00430b4b.md","comments/client-side-properties-and-any-remote-linq-provider/00430b4b",{"_path":2347,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":2348,"description":2349,"id":2350,"name":2351,"email":2352,"avatar":2353,"date":2354,"body":2355,"_type":2223,"_id":2363,"_source":2225,"_file":2364,"_stem":2365,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/157605","157605","Hello,\nThe error i'm getting is this one : \"Cannot compare elements of type 'System.Collections.Generic.ICollection`1 Only primitive types, enumeration types and entity types are supported\".\nSo it correspond to what you said earlier. Does it exist a way to solve this kind of issue?",157605,"Nadège","evergladeluv@hotmail.com","https://www.gravatar.com/avatar/8b9d9b3df4b6b335f747d74087ee8631?r=pg&d=retro","2016-03-10T01:29:40",{"type":12,"children":2356,"toc":2361},[2357],{"type":15,"tag":16,"props":2358,"children":2359},{},[2360],{"type":20,"value":2349},{"title":99,"searchDepth":137,"depth":137,"links":2362},[],"content:comments:client-side-properties-and-any-remote-linq-provider:157605.md","comments/client-side-properties-and-any-remote-linq-provider/157605.md","comments/client-side-properties-and-any-remote-linq-provider/157605",{"_path":2367,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":2368,"description":2369,"id":2370,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":2375,"body":2376,"_type":2223,"_id":2384,"_source":2225,"_file":2385,"_stem":2386,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/157598","157598","For the server side to filter on it the expression must be translatable to the remote source.  String.Join is definitely not something that can be translated as it has no SQL equivalent.  Is that the error you are getting?",157598,"Damien Guard","damien@envytech.co.uk","https://www.gravatar.com/avatar/dc72963e7279d34c85ed4c0b731ce5a9?r=pg&d=retro","https://damieng.com/","2016-03-09T09:35:54",{"type":12,"children":2377,"toc":2382},[2378],{"type":15,"tag":16,"props":2379,"children":2380},{},[2381],{"type":20,"value":2369},{"title":99,"searchDepth":137,"depth":137,"links":2383},[],"content:comments:client-side-properties-and-any-remote-linq-provider:157598.md","comments/client-side-properties-and-any-remote-linq-provider/157598.md","comments/client-side-properties-and-any-remote-linq-provider/157598",{"_path":2388,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":2389,"description":2390,"id":2391,"name":2351,"email":2352,"avatar":2353,"date":2392,"body":2393,"_type":2223,"_id":2994,"_source":2225,"_file":2995,"_stem":2996,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/157592","157592","Hello,\nI'm facing the same problem but i cannot find a way to solve this.",157592,"2016-03-09T05:12:12",{"type":12,"children":2394,"toc":2992},[2395,2399,2404,2409,2414,2422,2718,2726,2749,2757,2795,2803,2975,2988],{"type":15,"tag":16,"props":2396,"children":2397},{},[2398],{"type":20,"value":2390},{"type":15,"tag":16,"props":2400,"children":2401},{},[2402],{"type":20,"value":2403},"I'm working with EF4. My class \"User\" contains a list of object \"Actors\". I've created a custom propery which evaluate a compiledExpression named \"ActorsName\".\nThe mapper between entity and model is only like : model.ActorsName = entity = ActorsName.\nThe \"WithTranslations()\" method is called over the query.\nThe datagrid is bound on the property ActorsName correctly. The datas are displayed.",{"type":15,"tag":16,"props":2405,"children":2406},{},[2407],{"type":20,"value":2408},"However, i cannot filter or sort this computed column.\nDoes someone have a suggestion for me?\nThanks",{"type":15,"tag":16,"props":2410,"children":2411},{},[2412],{"type":20,"value":2413},"Informations:",{"type":15,"tag":1433,"props":2415,"children":2416},{},[2417],{"type":15,"tag":1437,"props":2418,"children":2419},{},[2420],{"type":20,"value":2421},"Custom partial class of the entity :",{"type":15,"tag":94,"props":2423,"children":2425},{"className":96,"code":2424,"language":98,"meta":99,"style":99},"private static readonly CompiledExpression LibActorsNameExpression\n= DefaultTranslationOf.Property(e => e.ActorsName).Is(u=> u.Actors != null ? string.Join(\", \", u.Actors.OrderBy(o => o.Name).Select(item => item.Name).ToArray()) : string.Empty);\npublic string ActorsName{ get { return LibActorsNameExpression.Evaluate(this); } }\n}\n",[2426],{"type":15,"tag":102,"props":2427,"children":2428},{"__ignoreMap":99},[2429,2450,2669,2711],{"type":15,"tag":106,"props":2430,"children":2431},{"class":108,"line":109},[2432,2437,2441,2445],{"type":15,"tag":106,"props":2433,"children":2434},{"style":113},[2435],{"type":20,"value":2436},"private",{"type":15,"tag":106,"props":2438,"children":2439},{"style":113},[2440],{"type":20,"value":657},{"type":15,"tag":106,"props":2442,"children":2443},{"style":113},[2444],{"type":20,"value":662},{"type":15,"tag":106,"props":2446,"children":2447},{"style":131},[2448],{"type":20,"value":2449}," CompiledExpression LibActorsNameExpression\n",{"type":15,"tag":106,"props":2451,"children":2452},{"class":108,"line":137},[2453,2457,2462,2466,2470,2474,2478,2482,2487,2491,2495,2499,2504,2508,2513,2518,2523,2528,2533,2537,2541,2546,2550,2554,2558,2562,2567,2571,2575,2580,2584,2589,2593,2598,2602,2606,2611,2615,2620,2624,2629,2633,2637,2642,2647,2652,2656,2660,2665],{"type":15,"tag":106,"props":2454,"children":2455},{"style":113},[2456],{"type":20,"value":487},{"type":15,"tag":106,"props":2458,"children":2459},{"style":131},[2460],{"type":20,"value":2461}," DefaultTranslationOf.",{"type":15,"tag":106,"props":2463,"children":2464},{"style":504},[2465],{"type":20,"value":720},{"type":15,"tag":106,"props":2467,"children":2468},{"style":131},[2469],{"type":20,"value":522},{"type":15,"tag":106,"props":2471,"children":2472},{"style":525},[2473],{"type":20,"value":528},{"type":15,"tag":106,"props":2475,"children":2476},{"style":113},[2477],{"type":20,"value":533},{"type":15,"tag":106,"props":2479,"children":2480},{"style":131},[2481],{"type":20,"value":538},{"type":15,"tag":106,"props":2483,"children":2484},{"style":264},[2485],{"type":20,"value":2486},"ActorsName",{"type":15,"tag":106,"props":2488,"children":2489},{"style":131},[2490],{"type":20,"value":745},{"type":15,"tag":106,"props":2492,"children":2493},{"style":504},[2494],{"type":20,"value":750},{"type":15,"tag":106,"props":2496,"children":2497},{"style":131},[2498],{"type":20,"value":522},{"type":15,"tag":106,"props":2500,"children":2501},{"style":525},[2502],{"type":20,"value":2503},"u",{"type":15,"tag":106,"props":2505,"children":2506},{"style":113},[2507],{"type":20,"value":2318},{"type":15,"tag":106,"props":2509,"children":2510},{"style":131},[2511],{"type":20,"value":2512}," u.",{"type":15,"tag":106,"props":2514,"children":2515},{"style":264},[2516],{"type":20,"value":2517},"Actors",{"type":15,"tag":106,"props":2519,"children":2520},{"style":113},[2521],{"type":20,"value":2522}," !=",{"type":15,"tag":106,"props":2524,"children":2525},{"style":416},[2526],{"type":20,"value":2527}," null",{"type":15,"tag":106,"props":2529,"children":2530},{"style":113},[2531],{"type":20,"value":2532}," ?",{"type":15,"tag":106,"props":2534,"children":2535},{"style":146},[2536],{"type":20,"value":149},{"type":15,"tag":106,"props":2538,"children":2539},{"style":131},[2540],{"type":20,"value":272},{"type":15,"tag":106,"props":2542,"children":2543},{"style":504},[2544],{"type":20,"value":2545},"Join",{"type":15,"tag":106,"props":2547,"children":2548},{"style":131},[2549],{"type":20,"value":522},{"type":15,"tag":106,"props":2551,"children":2552},{"style":186},[2553],{"type":20,"value":561},{"type":15,"tag":106,"props":2555,"children":2556},{"style":564},[2557],{"type":20,"value":1876},{"type":15,"tag":106,"props":2559,"children":2560},{"style":186},[2561],{"type":20,"value":561},{"type":15,"tag":106,"props":2563,"children":2564},{"style":131},[2565],{"type":20,"value":2566},", u.",{"type":15,"tag":106,"props":2568,"children":2569},{"style":264},[2570],{"type":20,"value":2517},{"type":15,"tag":106,"props":2572,"children":2573},{"style":131},[2574],{"type":20,"value":272},{"type":15,"tag":106,"props":2576,"children":2577},{"style":504},[2578],{"type":20,"value":2579},"OrderBy",{"type":15,"tag":106,"props":2581,"children":2582},{"style":131},[2583],{"type":20,"value":522},{"type":15,"tag":106,"props":2585,"children":2586},{"style":525},[2587],{"type":20,"value":2588},"o",{"type":15,"tag":106,"props":2590,"children":2591},{"style":113},[2592],{"type":20,"value":533},{"type":15,"tag":106,"props":2594,"children":2595},{"style":131},[2596],{"type":20,"value":2597}," o.",{"type":15,"tag":106,"props":2599,"children":2600},{"style":264},[2601],{"type":20,"value":1901},{"type":15,"tag":106,"props":2603,"children":2604},{"style":131},[2605],{"type":20,"value":745},{"type":15,"tag":106,"props":2607,"children":2608},{"style":504},[2609],{"type":20,"value":2610},"Select",{"type":15,"tag":106,"props":2612,"children":2613},{"style":131},[2614],{"type":20,"value":522},{"type":15,"tag":106,"props":2616,"children":2617},{"style":525},[2618],{"type":20,"value":2619},"item",{"type":15,"tag":106,"props":2621,"children":2622},{"style":113},[2623],{"type":20,"value":533},{"type":15,"tag":106,"props":2625,"children":2626},{"style":131},[2627],{"type":20,"value":2628}," item.",{"type":15,"tag":106,"props":2630,"children":2631},{"style":264},[2632],{"type":20,"value":1901},{"type":15,"tag":106,"props":2634,"children":2635},{"style":131},[2636],{"type":20,"value":745},{"type":15,"tag":106,"props":2638,"children":2639},{"style":504},[2640],{"type":20,"value":2641},"ToArray",{"type":15,"tag":106,"props":2643,"children":2644},{"style":131},[2645],{"type":20,"value":2646},"()) ",{"type":15,"tag":106,"props":2648,"children":2649},{"style":113},[2650],{"type":20,"value":2651},":",{"type":15,"tag":106,"props":2653,"children":2654},{"style":146},[2655],{"type":20,"value":149},{"type":15,"tag":106,"props":2657,"children":2658},{"style":131},[2659],{"type":20,"value":272},{"type":15,"tag":106,"props":2661,"children":2662},{"style":264},[2663],{"type":20,"value":2664},"Empty",{"type":15,"tag":106,"props":2666,"children":2667},{"style":131},[2668],{"type":20,"value":607},{"type":15,"tag":106,"props":2670,"children":2671},{"class":108,"line":157},[2672,2676,2680,2685,2689,2694,2698,2702,2706],{"type":15,"tag":106,"props":2673,"children":2674},{"style":113},[2675],{"type":20,"value":2129},{"type":15,"tag":106,"props":2677,"children":2678},{"style":146},[2679],{"type":20,"value":149},{"type":15,"tag":106,"props":2681,"children":2682},{"style":131},[2683],{"type":20,"value":2684}," ActorsName{ get { ",{"type":15,"tag":106,"props":2686,"children":2687},{"style":119},[2688],{"type":20,"value":173},{"type":15,"tag":106,"props":2690,"children":2691},{"style":131},[2692],{"type":20,"value":2693}," LibActorsNameExpression.",{"type":15,"tag":106,"props":2695,"children":2696},{"style":504},[2697],{"type":20,"value":1173},{"type":15,"tag":106,"props":2699,"children":2700},{"style":131},[2701],{"type":20,"value":522},{"type":15,"tag":106,"props":2703,"children":2704},{"style":1180},[2705],{"type":20,"value":1183},{"type":15,"tag":106,"props":2707,"children":2708},{"style":131},[2709],{"type":20,"value":2710},"); } }\n",{"type":15,"tag":106,"props":2712,"children":2713},{"class":108,"line":206},[2714],{"type":15,"tag":106,"props":2715,"children":2716},{"style":131},[2717],{"type":20,"value":460},{"type":15,"tag":1433,"props":2719,"children":2720},{},[2721],{"type":15,"tag":1437,"props":2722,"children":2723},{},[2724],{"type":20,"value":2725},"Model :",{"type":15,"tag":94,"props":2727,"children":2729},{"className":96,"code":2728,"language":98,"meta":99,"style":99},"public string ActorsName {get;set;\n",[2730],{"type":15,"tag":102,"props":2731,"children":2732},{"__ignoreMap":99},[2733],{"type":15,"tag":106,"props":2734,"children":2735},{"class":108,"line":109},[2736,2740,2744],{"type":15,"tag":106,"props":2737,"children":2738},{"style":113},[2739],{"type":20,"value":2129},{"type":15,"tag":106,"props":2741,"children":2742},{"style":146},[2743],{"type":20,"value":149},{"type":15,"tag":106,"props":2745,"children":2746},{"style":131},[2747],{"type":20,"value":2748}," ActorsName {get;set;\n",{"type":15,"tag":1433,"props":2750,"children":2751},{},[2752],{"type":15,"tag":1437,"props":2753,"children":2754},{},[2755],{"type":20,"value":2756},"Mapper :",{"type":15,"tag":94,"props":2758,"children":2760},{"className":96,"code":2759,"language":98,"meta":99,"style":99},"model.ActorsName = entity.ActorsName;\n",[2761],{"type":15,"tag":102,"props":2762,"children":2763},{"__ignoreMap":99},[2764],{"type":15,"tag":106,"props":2765,"children":2766},{"class":108,"line":109},[2767,2772,2776,2781,2786,2790],{"type":15,"tag":106,"props":2768,"children":2769},{"style":131},[2770],{"type":20,"value":2771},"model.",{"type":15,"tag":106,"props":2773,"children":2774},{"style":264},[2775],{"type":20,"value":2486},{"type":15,"tag":106,"props":2777,"children":2778},{"style":113},[2779],{"type":20,"value":2780}," =",{"type":15,"tag":106,"props":2782,"children":2783},{"style":131},[2784],{"type":20,"value":2785}," entity.",{"type":15,"tag":106,"props":2787,"children":2788},{"style":264},[2789],{"type":20,"value":2486},{"type":15,"tag":106,"props":2791,"children":2792},{"style":131},[2793],{"type":20,"value":2794},";\n",{"type":15,"tag":1433,"props":2796,"children":2797},{},[2798],{"type":15,"tag":1437,"props":2799,"children":2800},{},[2801],{"type":20,"value":2802},"The datasource (i'm using kendo ui Grid)",{"type":15,"tag":94,"props":2804,"children":2806},{"className":96,"code":2805,"language":98,"meta":99,"style":99},"DataSourceResult result = usersrv.GetAll().ApplyKendoRequest(\nrequest, // contains filter, sort, paging, ...\nc => c.Nom, // default property to be sorted\nc => c.ToModel(this.User.Identity.Name, 1), // calling the mapper\n);\n",[2807],{"type":15,"tag":102,"props":2808,"children":2809},{"__ignoreMap":99},[2810,2850,2864,2895,2968],{"type":15,"tag":106,"props":2811,"children":2812},{"class":108,"line":109},[2813,2818,2822,2826,2831,2836,2840,2845],{"type":15,"tag":106,"props":2814,"children":2815},{"style":665},[2816],{"type":20,"value":2817},"DataSourceResult",{"type":15,"tag":106,"props":2819,"children":2820},{"style":131},[2821],{"type":20,"value":2283},{"type":15,"tag":106,"props":2823,"children":2824},{"style":113},[2825],{"type":20,"value":487},{"type":15,"tag":106,"props":2827,"children":2828},{"style":131},[2829],{"type":20,"value":2830}," usersrv.",{"type":15,"tag":106,"props":2832,"children":2833},{"style":504},[2834],{"type":20,"value":2835},"GetAll",{"type":15,"tag":106,"props":2837,"children":2838},{"style":131},[2839],{"type":20,"value":512},{"type":15,"tag":106,"props":2841,"children":2842},{"style":504},[2843],{"type":20,"value":2844},"ApplyKendoRequest",{"type":15,"tag":106,"props":2846,"children":2847},{"style":131},[2848],{"type":20,"value":2849},"(\n",{"type":15,"tag":106,"props":2851,"children":2852},{"class":108,"line":137},[2853,2858],{"type":15,"tag":106,"props":2854,"children":2855},{"style":131},[2856],{"type":20,"value":2857},"request, ",{"type":15,"tag":106,"props":2859,"children":2861},{"style":2860},"--shiki-default:#939F91;--shiki-default-font-style:italic;--shiki-dark:#6272A4;--shiki-dark-font-style:inherit",[2862],{"type":20,"value":2863},"// contains filter, sort, paging, ...\n",{"type":15,"tag":106,"props":2865,"children":2866},{"class":108,"line":157},[2867,2872,2876,2881,2886,2890],{"type":15,"tag":106,"props":2868,"children":2869},{"style":525},[2870],{"type":20,"value":2871},"c",{"type":15,"tag":106,"props":2873,"children":2874},{"style":113},[2875],{"type":20,"value":533},{"type":15,"tag":106,"props":2877,"children":2878},{"style":131},[2879],{"type":20,"value":2880}," c.",{"type":15,"tag":106,"props":2882,"children":2883},{"style":264},[2884],{"type":20,"value":2885},"Nom",{"type":15,"tag":106,"props":2887,"children":2888},{"style":131},[2889],{"type":20,"value":1876},{"type":15,"tag":106,"props":2891,"children":2892},{"style":2860},[2893],{"type":20,"value":2894},"// default property to be sorted\n",{"type":15,"tag":106,"props":2896,"children":2897},{"class":108,"line":206},[2898,2902,2906,2910,2915,2919,2923,2927,2932,2936,2941,2945,2949,2953,2958,2963],{"type":15,"tag":106,"props":2899,"children":2900},{"style":525},[2901],{"type":20,"value":2871},{"type":15,"tag":106,"props":2903,"children":2904},{"style":113},[2905],{"type":20,"value":533},{"type":15,"tag":106,"props":2907,"children":2908},{"style":131},[2909],{"type":20,"value":2880},{"type":15,"tag":106,"props":2911,"children":2912},{"style":504},[2913],{"type":20,"value":2914},"ToModel",{"type":15,"tag":106,"props":2916,"children":2917},{"style":131},[2918],{"type":20,"value":522},{"type":15,"tag":106,"props":2920,"children":2921},{"style":1180},[2922],{"type":20,"value":1183},{"type":15,"tag":106,"props":2924,"children":2925},{"style":131},[2926],{"type":20,"value":272},{"type":15,"tag":106,"props":2928,"children":2929},{"style":264},[2930],{"type":20,"value":2931},"User",{"type":15,"tag":106,"props":2933,"children":2934},{"style":131},[2935],{"type":20,"value":272},{"type":15,"tag":106,"props":2937,"children":2938},{"style":264},[2939],{"type":20,"value":2940},"Identity",{"type":15,"tag":106,"props":2942,"children":2943},{"style":131},[2944],{"type":20,"value":272},{"type":15,"tag":106,"props":2946,"children":2947},{"style":264},[2948],{"type":20,"value":1901},{"type":15,"tag":106,"props":2950,"children":2951},{"style":131},[2952],{"type":20,"value":1876},{"type":15,"tag":106,"props":2954,"children":2955},{"style":416},[2956],{"type":20,"value":2957},"1",{"type":15,"tag":106,"props":2959,"children":2960},{"style":131},[2961],{"type":20,"value":2962},"), ",{"type":15,"tag":106,"props":2964,"children":2965},{"style":2860},[2966],{"type":20,"value":2967},"// calling the mapper\n",{"type":15,"tag":106,"props":2969,"children":2970},{"class":108,"line":215},[2971],{"type":15,"tag":106,"props":2972,"children":2973},{"style":131},[2974],{"type":20,"value":607},{"type":15,"tag":16,"props":2976,"children":2977},{},[2978,2980,2986],{"type":20,"value":2979},"ApplyKendoRequest : contains the query where we applied the method ",{"type":15,"tag":102,"props":2981,"children":2983},{"className":2982},[],[2984],{"type":20,"value":2985},"WithTranslations()",{"type":20,"value":2987}," on each call",{"type":15,"tag":2203,"props":2989,"children":2990},{},[2991],{"type":20,"value":2207},{"title":99,"searchDepth":137,"depth":137,"links":2993},[],"content:comments:client-side-properties-and-any-remote-linq-provider:157592.md","comments/client-side-properties-and-any-remote-linq-provider/157592.md","comments/client-side-properties-and-any-remote-linq-provider/157592",{"_path":2998,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":2999,"description":3000,"id":3001,"name":3002,"email":3003,"avatar":3004,"date":3005,"body":3006,"_type":2223,"_id":3024,"_source":2225,"_file":3025,"_stem":3026,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/65108","65108","We use strong name our assemblies and, because of that, can only reference other strong named assemblies.  You guys forgot to strong name Microsoft.Linq.Translations!",65108,"bojingo","nmartin@cardinalsolutions.com","https://www.gravatar.com/avatar/2d8ce5ef4d5bf5a6e8899c7743badcb2?r=pg&d=retro","2013-06-10T06:01:28",{"type":12,"children":3007,"toc":3022},[3008,3012,3017],{"type":15,"tag":16,"props":3009,"children":3010},{},[3011],{"type":20,"value":3000},{"type":15,"tag":16,"props":3013,"children":3014},{},[3015],{"type":20,"value":3016},"I am getting:\nError\t1\tAssembly generation failed -- Referenced assembly 'Microsoft.Linq.Translations' does not have a strong name",{"type":15,"tag":16,"props":3018,"children":3019},{},[3020],{"type":20,"value":3021},"Ugh.",{"title":99,"searchDepth":137,"depth":137,"links":3023},[],"content:comments:client-side-properties-and-any-remote-linq-provider:65108.md","comments/client-side-properties-and-any-remote-linq-provider/65108.md","comments/client-side-properties-and-any-remote-linq-provider/65108",{"_path":3028,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3029,"description":3030,"id":3031,"name":3032,"email":3033,"avatar":3034,"url":3035,"date":3036,"body":3037,"_type":2223,"_id":3059,"_source":2225,"_file":3060,"_stem":3061,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/63846","63846","I was able to solve my dilemma by overriding to the Query function and injecting a call to WithTranslations supplying the original expression.",63846,"Aaron","mcaden@gmail.com","https://www.gravatar.com/avatar/61fb18b11cf4c7552c2589f6013ed715?r=pg&d=retro","https://amoore.katalyststudios.com","2013-03-14T18:21:13",{"type":12,"children":3038,"toc":3057},[3039,3043,3048],{"type":15,"tag":16,"props":3040,"children":3041},{},[3042],{"type":20,"value":3030},{"type":15,"tag":16,"props":3044,"children":3045},{},[3046],{"type":20,"value":3047},"I based my code to override the query function off code found at the following forum post",{"type":15,"tag":16,"props":3049,"children":3050},{},[3051],{"type":15,"tag":41,"props":3052,"children":3055},{"href":3053,"rel":3054},"https://social.msdn.microsoft.com/Forums/en-US/silverlightwcf/thread/62d03153-d0dc-4797-8dc0-9fb207c528a9/",[45],[3056],{"type":20,"value":3053},{"title":99,"searchDepth":137,"depth":137,"links":3058},[],"content:comments:client-side-properties-and-any-remote-linq-provider:63846.md","comments/client-side-properties-and-any-remote-linq-provider/63846.md","comments/client-side-properties-and-any-remote-linq-provider/63846",{"_path":3063,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3064,"description":3065,"id":3066,"name":3032,"email":3033,"avatar":3034,"url":3035,"date":3067,"body":3068,"_type":2223,"_id":3081,"_source":2225,"_file":3082,"_stem":3083,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/63845","63845","This looks awesome however I'm having a problem with the constraints I have. I'm using this in a silverlight app where sorting/filtering and such can be done client side. Client-side the linq is generated to query my entities from RIA. However, with the query coming through in this manner there's no call to \"WithTranslations()\".",63845,"2013-03-14T17:12:44",{"type":12,"children":3069,"toc":3079},[3070,3074],{"type":15,"tag":16,"props":3071,"children":3072},{},[3073],{"type":20,"value":3065},{"type":15,"tag":16,"props":3075,"children":3076},{},[3077],{"type":20,"value":3078},"Any thoughts on a way to inject the call?",{"title":99,"searchDepth":137,"depth":137,"links":3080},[],"content:comments:client-side-properties-and-any-remote-linq-provider:63845.md","comments/client-side-properties-and-any-remote-linq-provider/63845.md","comments/client-side-properties-and-any-remote-linq-provider/63845",{"_path":3085,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3086,"description":3087,"id":3088,"name":3089,"email":3090,"avatar":3091,"date":3092,"body":3093,"_type":2223,"_id":3121,"_source":2225,"_file":3122,"_stem":3123,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/63686","63686","Righto! I narrowed down the source of problem.  My apologies for the litany of posts.",63686,"Lucas","duckaroy@gmail.com","https://www.gravatar.com/avatar/ebcd6c7a71bbe829adf8fb7a1201bcd4?r=pg&d=retro","2013-02-14T01:10:54",{"type":12,"children":3094,"toc":3119},[3095,3099,3104,3109,3114],{"type":15,"tag":16,"props":3096,"children":3097},{},[3098],{"type":20,"value":3087},{"type":15,"tag":16,"props":3100,"children":3101},{},[3102],{"type":20,"value":3103},"I'm writing LINQ queries using System.Data.Objects.EntityFunctions and System.Data.Objects.SqlClient.SqlFunctions, both of which use the EdmFunctionAttribute to map their canonical function to their equivallent store functions.  When i use these functions in my LINQ I get the classic \"LINQ to Entities does not recognize the method...\" error.",{"type":15,"tag":16,"props":3105,"children":3106},{},[3107],{"type":20,"value":3108},"I then realised there is another SqlFunctions class at System.Data.Entity.Core.Objects.SqlClient.SqlFunctions which uses DbFunctionAttribute instead of EdmFunctionAttribute.  The canonical functions in this class seem to work fine with Linq to Entities, in EntityFramework v5 and v6-alpha2.",{"type":15,"tag":16,"props":3110,"children":3111},{},[3112],{"type":20,"value":3113},"I guess my next question would be, what's the purpose of EdmFunctionAttribute; but that's for another time. :)",{"type":15,"tag":16,"props":3115,"children":3116},{},[3117],{"type":20,"value":3118},"Thanks again for this great blog post Damien.",{"title":99,"searchDepth":137,"depth":137,"links":3120},[],"content:comments:client-side-properties-and-any-remote-linq-provider:63686.md","comments/client-side-properties-and-any-remote-linq-provider/63686.md","comments/client-side-properties-and-any-remote-linq-provider/63686",{"_path":3125,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3126,"description":3127,"id":3128,"name":3089,"email":3090,"avatar":3091,"date":3129,"body":3130,"_type":2223,"_id":3138,"_source":2225,"_file":3139,"_stem":3140,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/63684","63684","After further testing it seems to be version 6.0.0-alpha2 of Entity Framework that is the cause of my problem.  Whenever I try to use SqlFunctions or EntityFunctions from within a CompiledExpression the Canonical function isn't recognised by the LINQ to Entities provider.  When I use version 5.0 of Entity Framework, it works fine.  Weird...",63684,"2013-02-13T18:54:55",{"type":12,"children":3131,"toc":3136},[3132],{"type":15,"tag":16,"props":3133,"children":3134},{},[3135],{"type":20,"value":3127},{"title":99,"searchDepth":137,"depth":137,"links":3137},[],"content:comments:client-side-properties-and-any-remote-linq-provider:63684.md","comments/client-side-properties-and-any-remote-linq-provider/63684.md","comments/client-side-properties-and-any-remote-linq-provider/63684",{"_path":3142,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3143,"description":3144,"id":3145,"name":3089,"email":3090,"avatar":3091,"date":3146,"body":3147,"_type":2223,"_id":3160,"_source":2225,"_file":3161,"_stem":3162,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/63682","63682","Great solution for this problem guys.  it would be great to see this sort of thing baked into the .net Framework.",63682,"2013-02-13T05:29:51",{"type":12,"children":3148,"toc":3158},[3149,3153],{"type":15,"tag":16,"props":3150,"children":3151},{},[3152],{"type":20,"value":3144},{"type":15,"tag":16,"props":3154,"children":3155},{},[3156],{"type":20,"value":3157},"Having said that, I seem to be having trouble using canonical functions from the SqlFunctions and EntityFunctions classes.  Would you expect functions like SqlFunctions.DateDiff to work within the expression of a CompiledExpression?",{"title":99,"searchDepth":137,"depth":137,"links":3159},[],"content:comments:client-side-properties-and-any-remote-linq-provider:63682.md","comments/client-side-properties-and-any-remote-linq-provider/63682.md","comments/client-side-properties-and-any-remote-linq-provider/63682",{"_path":3164,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3165,"description":3166,"id":3167,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":3168,"body":3169,"_type":2223,"_id":3182,"_source":2225,"_file":3183,"_stem":3184,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/63308","63308","What are you binding LinqDataSource too?",63308,"2012-12-01T14:23:11",{"type":12,"children":3170,"toc":3180},[3171,3175],{"type":15,"tag":16,"props":3172,"children":3173},{},[3174],{"type":20,"value":3166},{"type":15,"tag":16,"props":3176,"children":3177},{},[3178],{"type":20,"value":3179},"I suspect WithTranslations() is not in the method chain.  You need to make sure this method is part of the evaluation so it can rewrite the expression tree.",{"title":99,"searchDepth":137,"depth":137,"links":3181},[],"content:comments:client-side-properties-and-any-remote-linq-provider:63308.md","comments/client-side-properties-and-any-remote-linq-provider/63308.md","comments/client-side-properties-and-any-remote-linq-provider/63308",{"_path":3186,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3187,"description":3188,"id":3189,"name":3190,"email":3191,"avatar":3192,"date":3193,"body":3194,"_type":2223,"_id":3212,"_source":2225,"_file":3213,"_stem":3214,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/63307","63307","I've been trying this to use a custom property in a LinqDataSource's orderby attribute.  However, I'm still getting \"The member 'xxxx' has no supported translation to SQL.\" when performing a databind on a GridView which uses that LinqDataSource.",63307,"Zarepheth","zarepheth@hotmail.com","https://www.gravatar.com/avatar/dcd82bfa62ff50e131464a5c8d644288?r=pg&d=retro","2012-12-01T12:45:02",{"type":12,"children":3195,"toc":3210},[3196,3200,3205],{"type":15,"tag":16,"props":3197,"children":3198},{},[3199],{"type":20,"value":3188},{"type":15,"tag":16,"props":3201,"children":3202},{},[3203],{"type":20,"value":3204},"It's as though it's not even attempting to resolve the property's compiled expression.",{"type":15,"tag":16,"props":3206,"children":3207},{},[3208],{"type":20,"value":3209},"The custom property simply returns a boolean true/false based upon whether or not a datetime column in the underlying table has a value (e.DateFinished.HasValue).  With straight SQL, I'd use a CASE expression in the ORDER BY clause.  In LINQ to SQL code, I'd just specify the e.DateFinished.HasValue.  But an asp:LinqDataSource object doesn't like either approach.",{"title":99,"searchDepth":137,"depth":137,"links":3211},[],"content:comments:client-side-properties-and-any-remote-linq-provider:63307.md","comments/client-side-properties-and-any-remote-linq-provider/63307.md","comments/client-side-properties-and-any-remote-linq-provider/63307",{"_path":3216,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3217,"description":3218,"id":3219,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":3220,"body":3221,"_type":2223,"_id":3229,"_source":2225,"_file":3230,"_stem":3231,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/47961","47961","They should work just fine but bear in mind that even on the server an order by based on a calculation (which is what this effectively is) will not be as fast as one based on a stored value.",47961,"2012-04-11T10:41:57",{"type":12,"children":3222,"toc":3227},[3223],{"type":15,"tag":16,"props":3224,"children":3225},{},[3226],{"type":20,"value":3218},{"title":99,"searchDepth":137,"depth":137,"links":3228},[],"content:comments:client-side-properties-and-any-remote-linq-provider:47961.md","comments/client-side-properties-and-any-remote-linq-provider/47961.md","comments/client-side-properties-and-any-remote-linq-provider/47961",{"_path":3233,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3234,"description":3235,"id":3236,"name":3237,"email":3238,"avatar":3239,"date":3240,"body":3241,"_type":2223,"_id":3249,"_source":2225,"_file":3250,"_stem":3251,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/47960","47960","Great work Damien!  Are there any tricks to setting up these client side properties so that they can be used in OrderBy without needing to jump out to Ling to Objects?",47960,"Dave","javadave@speakeasy.net","https://www.gravatar.com/avatar/975f41f693461c4dce7181ef41e65ef8?r=pg&d=retro","2012-04-11T09:54:08",{"type":12,"children":3242,"toc":3247},[3243],{"type":15,"tag":16,"props":3244,"children":3245},{},[3246],{"type":20,"value":3235},{"title":99,"searchDepth":137,"depth":137,"links":3248},[],"content:comments:client-side-properties-and-any-remote-linq-provider:47960.md","comments/client-side-properties-and-any-remote-linq-provider/47960.md","comments/client-side-properties-and-any-remote-linq-provider/47960",{"_path":3253,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3254,"description":3255,"id":3256,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":3257,"body":3258,"_type":2223,"_id":3271,"_source":2225,"_file":3272,"_stem":3273,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/47860","47860","You can indeed - TranslationMap is a dictionary of PropertyInfo to CompiledExpression.",47860,"2012-03-20T12:29:14",{"type":12,"children":3259,"toc":3269},[3260,3264],{"type":15,"tag":16,"props":3261,"children":3262},{},[3263],{"type":20,"value":3255},{"type":15,"tag":16,"props":3265,"children":3266},{},[3267],{"type":20,"value":3268},"You'll need to add a getter to CompiledExpression to get out the Expression though.",{"title":99,"searchDepth":137,"depth":137,"links":3270},[],"content:comments:client-side-properties-and-any-remote-linq-provider:47860.md","comments/client-side-properties-and-any-remote-linq-provider/47860.md","comments/client-side-properties-and-any-remote-linq-provider/47860",{"_path":3275,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3276,"description":3277,"id":3278,"name":3279,"email":3280,"avatar":3281,"date":3282,"body":3283,"_type":2223,"_id":3291,"_source":2225,"_file":3292,"_stem":3293,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/47859","47859","Simple question: Can I get an expression for a property out of the TranslationMap?",47859,"Stefan","bad@toobad.de","https://www.gravatar.com/avatar/a61bb170d02b58920913ed542ccbb728?r=pg&d=retro","2012-03-20T12:14:35",{"type":12,"children":3284,"toc":3289},[3285],{"type":15,"tag":16,"props":3286,"children":3287},{},[3288],{"type":20,"value":3277},{"title":99,"searchDepth":137,"depth":137,"links":3290},[],"content:comments:client-side-properties-and-any-remote-linq-provider:47859.md","comments/client-side-properties-and-any-remote-linq-provider/47859.md","comments/client-side-properties-and-any-remote-linq-provider/47859",{"_path":3295,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3296,"description":3297,"id":3298,"name":3299,"email":3300,"avatar":3301,"date":3302,"body":3303,"_type":2223,"_id":3725,"_source":2225,"_file":3726,"_stem":3727,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/47000","47000","Great work! Any suggestions on how this might be used with interfaces?",47000,"Patrick","prog.rogers@gmail.com","https://www.gravatar.com/avatar/4a6dbcd75c04a8f7284bd1e2aa800faf?r=pg&d=retro","2011-12-09T18:52:18",{"type":12,"children":3304,"toc":3723},[3305,3309,3314,3371,3376,3594,3599,3703,3714,3719],{"type":15,"tag":16,"props":3306,"children":3307},{},[3308],{"type":20,"value":3297},{"type":15,"tag":16,"props":3310,"children":3311},{},[3312],{"type":20,"value":3313},"Say you have the interface:",{"type":15,"tag":94,"props":3315,"children":3317},{"className":96,"code":3316,"language":98,"meta":99,"style":99},"public interface IElement {\n    int UniqueId { get; }\n}\n",[3318],{"type":15,"tag":102,"props":3319,"children":3320},{"__ignoreMap":99},[3321,3342,3364],{"type":15,"tag":106,"props":3322,"children":3323},{"class":108,"line":109},[3324,3328,3333,3338],{"type":15,"tag":106,"props":3325,"children":3326},{"style":113},[3327],{"type":20,"value":2129},{"type":15,"tag":106,"props":3329,"children":3330},{"style":119},[3331],{"type":20,"value":3332}," interface",{"type":15,"tag":106,"props":3334,"children":3335},{"style":665},[3336],{"type":20,"value":3337}," IElement",{"type":15,"tag":106,"props":3339,"children":3340},{"style":131},[3341],{"type":20,"value":134},{"type":15,"tag":106,"props":3343,"children":3344},{"class":108,"line":137},[3345,3350,3355,3359],{"type":15,"tag":106,"props":3346,"children":3347},{"style":146},[3348],{"type":20,"value":3349},"    int",{"type":15,"tag":106,"props":3351,"children":3352},{"style":131},[3353],{"type":20,"value":3354}," UniqueId { ",{"type":15,"tag":106,"props":3356,"children":3357},{"style":146},[3358],{"type":20,"value":1729},{"type":15,"tag":106,"props":3360,"children":3361},{"style":131},[3362],{"type":20,"value":3363},"; }\n",{"type":15,"tag":106,"props":3365,"children":3366},{"class":108,"line":157},[3367],{"type":15,"tag":106,"props":3368,"children":3369},{"style":131},[3370],{"type":20,"value":460},{"type":15,"tag":16,"props":3372,"children":3373},{},[3374],{"type":20,"value":3375},"and various classes that implement the interface such as:",{"type":15,"tag":94,"props":3377,"children":3379},{"className":96,"code":3378,"language":98,"meta":99,"style":99},"public class User : IElement {\n    private static readonly CompiledExpression _idExpression = DefaultTranslationOf.Property(x => x.UniqueId).Is(x => x.UserId);\n    public int UniqueId { get { return _idExpression.Evaluate(this); } }\n    public int UserId { get; set; }\n}\n",[3380],{"type":15,"tag":102,"props":3381,"children":3382},{"__ignoreMap":99},[3383,3413,3505,3553,3587],{"type":15,"tag":106,"props":3384,"children":3385},{"class":108,"line":109},[3386,3390,3394,3399,3404,3409],{"type":15,"tag":106,"props":3387,"children":3388},{"style":113},[3389],{"type":20,"value":2129},{"type":15,"tag":106,"props":3391,"children":3392},{"style":119},[3393],{"type":20,"value":122},{"type":15,"tag":106,"props":3395,"children":3396},{"style":125},[3397],{"type":20,"value":3398}," User",{"type":15,"tag":106,"props":3400,"children":3401},{"style":131},[3402],{"type":20,"value":3403}," : ",{"type":15,"tag":106,"props":3405,"children":3406},{"style":665},[3407],{"type":20,"value":3408},"IElement",{"type":15,"tag":106,"props":3410,"children":3411},{"style":131},[3412],{"type":20,"value":134},{"type":15,"tag":106,"props":3414,"children":3415},{"class":108,"line":137},[3416,3420,3424,3428,3432,3437,3441,3445,3449,3453,3458,3462,3467,3472,3476,3480,3484,3488,3492,3496,3501],{"type":15,"tag":106,"props":3417,"children":3418},{"style":113},[3419],{"type":20,"value":652},{"type":15,"tag":106,"props":3421,"children":3422},{"style":113},[3423],{"type":20,"value":657},{"type":15,"tag":106,"props":3425,"children":3426},{"style":113},[3427],{"type":20,"value":662},{"type":15,"tag":106,"props":3429,"children":3430},{"style":665},[3431],{"type":20,"value":668},{"type":15,"tag":106,"props":3433,"children":3434},{"style":131},[3435],{"type":20,"value":3436}," _idExpression ",{"type":15,"tag":106,"props":3438,"children":3439},{"style":113},[3440],{"type":20,"value":487},{"type":15,"tag":106,"props":3442,"children":3443},{"style":131},[3444],{"type":20,"value":2461},{"type":15,"tag":106,"props":3446,"children":3447},{"style":504},[3448],{"type":20,"value":720},{"type":15,"tag":106,"props":3450,"children":3451},{"style":131},[3452],{"type":20,"value":522},{"type":15,"tag":106,"props":3454,"children":3455},{"style":525},[3456],{"type":20,"value":3457},"x",{"type":15,"tag":106,"props":3459,"children":3460},{"style":113},[3461],{"type":20,"value":533},{"type":15,"tag":106,"props":3463,"children":3464},{"style":131},[3465],{"type":20,"value":3466}," x.",{"type":15,"tag":106,"props":3468,"children":3469},{"style":264},[3470],{"type":20,"value":3471},"UniqueId",{"type":15,"tag":106,"props":3473,"children":3474},{"style":131},[3475],{"type":20,"value":745},{"type":15,"tag":106,"props":3477,"children":3478},{"style":504},[3479],{"type":20,"value":750},{"type":15,"tag":106,"props":3481,"children":3482},{"style":131},[3483],{"type":20,"value":522},{"type":15,"tag":106,"props":3485,"children":3486},{"style":525},[3487],{"type":20,"value":3457},{"type":15,"tag":106,"props":3489,"children":3490},{"style":113},[3491],{"type":20,"value":533},{"type":15,"tag":106,"props":3493,"children":3494},{"style":131},[3495],{"type":20,"value":3466},{"type":15,"tag":106,"props":3497,"children":3498},{"style":264},[3499],{"type":20,"value":3500},"UserId",{"type":15,"tag":106,"props":3502,"children":3503},{"style":131},[3504],{"type":20,"value":607},{"type":15,"tag":106,"props":3506,"children":3507},{"class":108,"line":157},[3508,3512,3516,3520,3524,3528,3532,3537,3541,3545,3549],{"type":15,"tag":106,"props":3509,"children":3510},{"style":113},[3511],{"type":20,"value":1715},{"type":15,"tag":106,"props":3513,"children":3514},{"style":146},[3515],{"type":20,"value":235},{"type":15,"tag":106,"props":3517,"children":3518},{"style":131},[3519],{"type":20,"value":3354},{"type":15,"tag":106,"props":3521,"children":3522},{"style":146},[3523],{"type":20,"value":1729},{"type":15,"tag":106,"props":3525,"children":3526},{"style":131},[3527],{"type":20,"value":168},{"type":15,"tag":106,"props":3529,"children":3530},{"style":119},[3531],{"type":20,"value":173},{"type":15,"tag":106,"props":3533,"children":3534},{"style":131},[3535],{"type":20,"value":3536}," _idExpression.",{"type":15,"tag":106,"props":3538,"children":3539},{"style":504},[3540],{"type":20,"value":1173},{"type":15,"tag":106,"props":3542,"children":3543},{"style":131},[3544],{"type":20,"value":522},{"type":15,"tag":106,"props":3546,"children":3547},{"style":1180},[3548],{"type":20,"value":1183},{"type":15,"tag":106,"props":3550,"children":3551},{"style":131},[3552],{"type":20,"value":2710},{"type":15,"tag":106,"props":3554,"children":3555},{"class":108,"line":206},[3556,3560,3564,3569,3573,3578,3583],{"type":15,"tag":106,"props":3557,"children":3558},{"style":113},[3559],{"type":20,"value":1715},{"type":15,"tag":106,"props":3561,"children":3562},{"style":146},[3563],{"type":20,"value":235},{"type":15,"tag":106,"props":3565,"children":3566},{"style":131},[3567],{"type":20,"value":3568}," UserId { ",{"type":15,"tag":106,"props":3570,"children":3571},{"style":146},[3572],{"type":20,"value":1729},{"type":15,"tag":106,"props":3574,"children":3575},{"style":131},[3576],{"type":20,"value":3577},"; ",{"type":15,"tag":106,"props":3579,"children":3580},{"style":146},[3581],{"type":20,"value":3582},"set",{"type":15,"tag":106,"props":3584,"children":3585},{"style":131},[3586],{"type":20,"value":3363},{"type":15,"tag":106,"props":3588,"children":3589},{"class":108,"line":215},[3590],{"type":15,"tag":106,"props":3591,"children":3592},{"style":131},[3593],{"type":20,"value":460},{"type":15,"tag":16,"props":3595,"children":3596},{},[3597],{"type":20,"value":3598},"Here's what I'm attempting to do at the moment, which doesn't work because the interface is being used:",{"type":15,"tag":94,"props":3600,"children":3602},{"className":96,"code":3601,"language":98,"meta":99,"style":99},"IQueryable source; // (could be assigned with an IQueryable on instantiation)\nIList results = source.Where(x => x.UniqueId == 1).WithTranslations().ToList(); // this line causes the problem, as long as the interface is used.\n",[3603],{"type":15,"tag":102,"props":3604,"children":3605},{"__ignoreMap":99},[3606,3624],{"type":15,"tag":106,"props":3607,"children":3608},{"class":108,"line":109},[3609,3614,3619],{"type":15,"tag":106,"props":3610,"children":3611},{"style":665},[3612],{"type":20,"value":3613},"IQueryable",{"type":15,"tag":106,"props":3615,"children":3616},{"style":131},[3617],{"type":20,"value":3618}," source; ",{"type":15,"tag":106,"props":3620,"children":3621},{"style":2860},[3622],{"type":20,"value":3623},"// (could be assigned with an IQueryable on instantiation)\n",{"type":15,"tag":106,"props":3625,"children":3626},{"class":108,"line":137},[3627,3632,3636,3640,3645,3649,3653,3657,3661,3665,3669,3673,3677,3681,3685,3689,3693,3698],{"type":15,"tag":106,"props":3628,"children":3629},{"style":665},[3630],{"type":20,"value":3631},"IList",{"type":15,"tag":106,"props":3633,"children":3634},{"style":131},[3635],{"type":20,"value":1963},{"type":15,"tag":106,"props":3637,"children":3638},{"style":113},[3639],{"type":20,"value":487},{"type":15,"tag":106,"props":3641,"children":3642},{"style":131},[3643],{"type":20,"value":3644}," source.",{"type":15,"tag":106,"props":3646,"children":3647},{"style":504},[3648],{"type":20,"value":517},{"type":15,"tag":106,"props":3650,"children":3651},{"style":131},[3652],{"type":20,"value":522},{"type":15,"tag":106,"props":3654,"children":3655},{"style":525},[3656],{"type":20,"value":3457},{"type":15,"tag":106,"props":3658,"children":3659},{"style":113},[3660],{"type":20,"value":533},{"type":15,"tag":106,"props":3662,"children":3663},{"style":131},[3664],{"type":20,"value":3466},{"type":15,"tag":106,"props":3666,"children":3667},{"style":264},[3668],{"type":20,"value":3471},{"type":15,"tag":106,"props":3670,"children":3671},{"style":113},[3672],{"type":20,"value":361},{"type":15,"tag":106,"props":3674,"children":3675},{"style":416},[3676],{"type":20,"value":419},{"type":15,"tag":106,"props":3678,"children":3679},{"style":131},[3680],{"type":20,"value":745},{"type":15,"tag":106,"props":3682,"children":3683},{"style":504},[3684],{"type":20,"value":1389},{"type":15,"tag":106,"props":3686,"children":3687},{"style":131},[3688],{"type":20,"value":512},{"type":15,"tag":106,"props":3690,"children":3691},{"style":504},[3692],{"type":20,"value":507},{"type":15,"tag":106,"props":3694,"children":3695},{"style":131},[3696],{"type":20,"value":3697},"(); ",{"type":15,"tag":106,"props":3699,"children":3700},{"style":2860},[3701],{"type":20,"value":3702},"// this line causes the problem, as long as the interface is used.\n",{"type":15,"tag":16,"props":3704,"children":3705},{},[3706,3708],{"type":20,"value":3707},"Any ideas? I think the post above was attempting something similar. I found another post at the following address, but couldn't quite figure out what the solution was:\n",{"type":15,"tag":41,"props":3709,"children":3712},{"href":3710,"rel":3711},"https://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/3b401086-2c58-4bd0-845b-e0209f9cdcf5",[45],[3713],{"type":20,"value":3710},{"type":15,"tag":16,"props":3715,"children":3716},{},[3717],{"type":20,"value":3718},"Thanks!",{"type":15,"tag":2203,"props":3720,"children":3721},{},[3722],{"type":20,"value":2207},{"title":99,"searchDepth":137,"depth":137,"links":3724},[],"content:comments:client-side-properties-and-any-remote-linq-provider:47000.md","comments/client-side-properties-and-any-remote-linq-provider/47000.md","comments/client-side-properties-and-any-remote-linq-provider/47000",{"_path":3729,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3730,"description":3731,"id":3732,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":3733,"body":3734,"_type":2223,"_id":3750,"_source":2225,"_file":3751,"_stem":3752,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46897","46897","You can grab a copy of the ExpressionVisitor class from the IQToolkit",46897,"2011-11-10T08:49:50",{"type":12,"children":3735,"toc":3748},[3736],{"type":15,"tag":16,"props":3737,"children":3738},{},[3739,3741],{"type":20,"value":3740},"You can grab a copy of the ExpressionVisitor class from the ",{"type":15,"tag":41,"props":3742,"children":3745},{"href":3743,"rel":3744},"https://github.com/mattwar/iqtoolkit",[45],[3746],{"type":20,"value":3747},"IQToolkit",{"title":99,"searchDepth":137,"depth":137,"links":3749},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46897.md","comments/client-side-properties-and-any-remote-linq-provider/46897.md","comments/client-side-properties-and-any-remote-linq-provider/46897",{"_path":3754,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":3755,"description":3756,"id":3757,"name":3758,"email":3759,"avatar":3760,"url":3761,"date":3762,"body":3763,"_type":2223,"_id":4269,"_source":2225,"_file":4270,"_stem":4271,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46872","46872","Damien,",46872,"Don Wilcox","don@mypeoplematter.com","https://www.gravatar.com/avatar/ef1a1b48ad2b64b6469cc943f0eb5407?r=pg&d=retro","https://www.mypeoplematter.com","2011-11-07T09:13:03",{"type":12,"children":3764,"toc":4267},[3765,3769,3774,4148,4153,4250,4263],{"type":15,"tag":16,"props":3766,"children":3767},{},[3768],{"type":20,"value":3756},{"type":15,"tag":16,"props":3770,"children":3771},{},[3772],{"type":20,"value":3773},"I have attempted to use your library so solve a problem I originally asked in StackOverflow. I have a class ClientID to wrap an Int64 ID:",{"type":15,"tag":94,"props":3775,"children":3777},{"className":96,"code":3776,"language":98,"meta":99,"style":99},"class ClientID {\n    public Int64 Value {\n        get { return cidExpression.Evaluate(this); }\n        private set { m_Value = value; }\n    }\n    public static bool operator ==(ClientID lhs, Int64 rhs) { return lhs.Value == rhs; }\n    public static bool operator ==(Int64 lhs, ClientID rhs) { return rhs == lhs; }\n    private Int64 m_Value;\n    private static readonly CompiledExpression cidExpression = DefaultTranslationOf.Property(e => e.Value).Is(e => e.m_Value);\n}\n",[3778],{"type":15,"tag":102,"props":3779,"children":3780},{"__ignoreMap":99},[3781,3798,3815,3852,3879,3886,3966,4036,4052,4141],{"type":15,"tag":106,"props":3782,"children":3783},{"class":108,"line":109},[3784,3789,3794],{"type":15,"tag":106,"props":3785,"children":3786},{"style":119},[3787],{"type":20,"value":3788},"class",{"type":15,"tag":106,"props":3790,"children":3791},{"style":125},[3792],{"type":20,"value":3793}," ClientID",{"type":15,"tag":106,"props":3795,"children":3796},{"style":131},[3797],{"type":20,"value":134},{"type":15,"tag":106,"props":3799,"children":3800},{"class":108,"line":137},[3801,3805,3810],{"type":15,"tag":106,"props":3802,"children":3803},{"style":113},[3804],{"type":20,"value":1715},{"type":15,"tag":106,"props":3806,"children":3807},{"style":665},[3808],{"type":20,"value":3809}," Int64",{"type":15,"tag":106,"props":3811,"children":3812},{"style":131},[3813],{"type":20,"value":3814}," Value {\n",{"type":15,"tag":106,"props":3816,"children":3817},{"class":108,"line":157},[3818,3823,3827,3831,3836,3840,3844,3848],{"type":15,"tag":106,"props":3819,"children":3820},{"style":146},[3821],{"type":20,"value":3822},"        get",{"type":15,"tag":106,"props":3824,"children":3825},{"style":131},[3826],{"type":20,"value":168},{"type":15,"tag":106,"props":3828,"children":3829},{"style":119},[3830],{"type":20,"value":173},{"type":15,"tag":106,"props":3832,"children":3833},{"style":131},[3834],{"type":20,"value":3835}," cidExpression.",{"type":15,"tag":106,"props":3837,"children":3838},{"style":504},[3839],{"type":20,"value":1173},{"type":15,"tag":106,"props":3841,"children":3842},{"style":131},[3843],{"type":20,"value":522},{"type":15,"tag":106,"props":3845,"children":3846},{"style":1180},[3847],{"type":20,"value":1183},{"type":15,"tag":106,"props":3849,"children":3850},{"style":131},[3851],{"type":20,"value":1188},{"type":15,"tag":106,"props":3853,"children":3854},{"class":108,"line":206},[3855,3860,3865,3870,3874],{"type":15,"tag":106,"props":3856,"children":3857},{"style":113},[3858],{"type":20,"value":3859},"        private",{"type":15,"tag":106,"props":3861,"children":3862},{"style":146},[3863],{"type":20,"value":3864}," set",{"type":15,"tag":106,"props":3866,"children":3867},{"style":131},[3868],{"type":20,"value":3869}," { m_Value ",{"type":15,"tag":106,"props":3871,"children":3872},{"style":113},[3873],{"type":20,"value":487},{"type":15,"tag":106,"props":3875,"children":3876},{"style":131},[3877],{"type":20,"value":3878}," value; }\n",{"type":15,"tag":106,"props":3880,"children":3881},{"class":108,"line":215},[3882],{"type":15,"tag":106,"props":3883,"children":3884},{"style":131},[3885],{"type":20,"value":443},{"type":15,"tag":106,"props":3887,"children":3888},{"class":108,"line":225},[3889,3893,3897,3902,3907,3911,3915,3920,3925,3929,3934,3939,3944,3948,3953,3957,3961],{"type":15,"tag":106,"props":3890,"children":3891},{"style":113},[3892],{"type":20,"value":1715},{"type":15,"tag":106,"props":3894,"children":3895},{"style":113},[3896],{"type":20,"value":657},{"type":15,"tag":106,"props":3898,"children":3899},{"style":146},[3900],{"type":20,"value":3901}," bool",{"type":15,"tag":106,"props":3903,"children":3904},{"style":146},[3905],{"type":20,"value":3906}," operator",{"type":15,"tag":106,"props":3908,"children":3909},{"style":504},[3910],{"type":20,"value":361},{"type":15,"tag":106,"props":3912,"children":3913},{"style":131},[3914],{"type":20,"value":522},{"type":15,"tag":106,"props":3916,"children":3917},{"style":665},[3918],{"type":20,"value":3919},"ClientID",{"type":15,"tag":106,"props":3921,"children":3922},{"style":525},[3923],{"type":20,"value":3924}," lhs",{"type":15,"tag":106,"props":3926,"children":3927},{"style":131},[3928],{"type":20,"value":1876},{"type":15,"tag":106,"props":3930,"children":3931},{"style":665},[3932],{"type":20,"value":3933},"Int64",{"type":15,"tag":106,"props":3935,"children":3936},{"style":525},[3937],{"type":20,"value":3938}," rhs",{"type":15,"tag":106,"props":3940,"children":3941},{"style":131},[3942],{"type":20,"value":3943},") { ",{"type":15,"tag":106,"props":3945,"children":3946},{"style":119},[3947],{"type":20,"value":173},{"type":15,"tag":106,"props":3949,"children":3950},{"style":131},[3951],{"type":20,"value":3952}," lhs.",{"type":15,"tag":106,"props":3954,"children":3955},{"style":264},[3956],{"type":20,"value":942},{"type":15,"tag":106,"props":3958,"children":3959},{"style":113},[3960],{"type":20,"value":361},{"type":15,"tag":106,"props":3962,"children":3963},{"style":131},[3964],{"type":20,"value":3965}," rhs; }\n",{"type":15,"tag":106,"props":3967,"children":3968},{"class":108,"line":243},[3969,3973,3977,3981,3985,3989,3993,3997,4001,4005,4009,4013,4017,4021,4026,4031],{"type":15,"tag":106,"props":3970,"children":3971},{"style":113},[3972],{"type":20,"value":1715},{"type":15,"tag":106,"props":3974,"children":3975},{"style":113},[3976],{"type":20,"value":657},{"type":15,"tag":106,"props":3978,"children":3979},{"style":146},[3980],{"type":20,"value":3901},{"type":15,"tag":106,"props":3982,"children":3983},{"style":146},[3984],{"type":20,"value":3906},{"type":15,"tag":106,"props":3986,"children":3987},{"style":504},[3988],{"type":20,"value":361},{"type":15,"tag":106,"props":3990,"children":3991},{"style":131},[3992],{"type":20,"value":522},{"type":15,"tag":106,"props":3994,"children":3995},{"style":665},[3996],{"type":20,"value":3933},{"type":15,"tag":106,"props":3998,"children":3999},{"style":525},[4000],{"type":20,"value":3924},{"type":15,"tag":106,"props":4002,"children":4003},{"style":131},[4004],{"type":20,"value":1876},{"type":15,"tag":106,"props":4006,"children":4007},{"style":665},[4008],{"type":20,"value":3919},{"type":15,"tag":106,"props":4010,"children":4011},{"style":525},[4012],{"type":20,"value":3938},{"type":15,"tag":106,"props":4014,"children":4015},{"style":131},[4016],{"type":20,"value":3943},{"type":15,"tag":106,"props":4018,"children":4019},{"style":119},[4020],{"type":20,"value":173},{"type":15,"tag":106,"props":4022,"children":4023},{"style":131},[4024],{"type":20,"value":4025}," rhs ",{"type":15,"tag":106,"props":4027,"children":4028},{"style":113},[4029],{"type":20,"value":4030},"==",{"type":15,"tag":106,"props":4032,"children":4033},{"style":131},[4034],{"type":20,"value":4035}," lhs; }\n",{"type":15,"tag":106,"props":4037,"children":4038},{"class":108,"line":334},[4039,4043,4047],{"type":15,"tag":106,"props":4040,"children":4041},{"style":113},[4042],{"type":20,"value":652},{"type":15,"tag":106,"props":4044,"children":4045},{"style":665},[4046],{"type":20,"value":3809},{"type":15,"tag":106,"props":4048,"children":4049},{"style":131},[4050],{"type":20,"value":4051}," m_Value;\n",{"type":15,"tag":106,"props":4053,"children":4054},{"class":108,"line":437},[4055,4059,4063,4067,4071,4076,4080,4084,4088,4092,4096,4100,4104,4108,4112,4116,4120,4124,4128,4132,4137],{"type":15,"tag":106,"props":4056,"children":4057},{"style":113},[4058],{"type":20,"value":652},{"type":15,"tag":106,"props":4060,"children":4061},{"style":113},[4062],{"type":20,"value":657},{"type":15,"tag":106,"props":4064,"children":4065},{"style":113},[4066],{"type":20,"value":662},{"type":15,"tag":106,"props":4068,"children":4069},{"style":665},[4070],{"type":20,"value":668},{"type":15,"tag":106,"props":4072,"children":4073},{"style":131},[4074],{"type":20,"value":4075}," cidExpression ",{"type":15,"tag":106,"props":4077,"children":4078},{"style":113},[4079],{"type":20,"value":487},{"type":15,"tag":106,"props":4081,"children":4082},{"style":131},[4083],{"type":20,"value":2461},{"type":15,"tag":106,"props":4085,"children":4086},{"style":504},[4087],{"type":20,"value":720},{"type":15,"tag":106,"props":4089,"children":4090},{"style":131},[4091],{"type":20,"value":522},{"type":15,"tag":106,"props":4093,"children":4094},{"style":525},[4095],{"type":20,"value":528},{"type":15,"tag":106,"props":4097,"children":4098},{"style":113},[4099],{"type":20,"value":533},{"type":15,"tag":106,"props":4101,"children":4102},{"style":131},[4103],{"type":20,"value":538},{"type":15,"tag":106,"props":4105,"children":4106},{"style":264},[4107],{"type":20,"value":942},{"type":15,"tag":106,"props":4109,"children":4110},{"style":131},[4111],{"type":20,"value":745},{"type":15,"tag":106,"props":4113,"children":4114},{"style":504},[4115],{"type":20,"value":750},{"type":15,"tag":106,"props":4117,"children":4118},{"style":131},[4119],{"type":20,"value":522},{"type":15,"tag":106,"props":4121,"children":4122},{"style":525},[4123],{"type":20,"value":528},{"type":15,"tag":106,"props":4125,"children":4126},{"style":113},[4127],{"type":20,"value":533},{"type":15,"tag":106,"props":4129,"children":4130},{"style":131},[4131],{"type":20,"value":538},{"type":15,"tag":106,"props":4133,"children":4134},{"style":264},[4135],{"type":20,"value":4136},"m_Value",{"type":15,"tag":106,"props":4138,"children":4139},{"style":131},[4140],{"type":20,"value":607},{"type":15,"tag":106,"props":4142,"children":4143},{"class":108,"line":446},[4144],{"type":15,"tag":106,"props":4145,"children":4146},{"style":131},[4147],{"type":20,"value":460},{"type":15,"tag":16,"props":4149,"children":4150},{},[4151],{"type":20,"value":4152},"I use it as:",{"type":15,"tag":94,"props":4154,"children":4156},{"className":96,"code":4155,"language":98,"meta":99,"style":99},"var q = dc.Notes.Where(f => f.CreatorParty.ClientID == clientID).WithTranslations().ToList();\n",[4157],{"type":15,"tag":102,"props":4158,"children":4159},{"__ignoreMap":99},[4160],{"type":15,"tag":106,"props":4161,"children":4162},{"class":108,"line":109},[4163,4167,4172,4176,4181,4186,4190,4194,4198,4203,4207,4212,4217,4221,4225,4229,4234,4238,4242,4246],{"type":15,"tag":106,"props":4164,"children":4165},{"style":146},[4166],{"type":20,"value":477},{"type":15,"tag":106,"props":4168,"children":4169},{"style":131},[4170],{"type":20,"value":4171}," q ",{"type":15,"tag":106,"props":4173,"children":4174},{"style":113},[4175],{"type":20,"value":487},{"type":15,"tag":106,"props":4177,"children":4178},{"style":131},[4179],{"type":20,"value":4180}," dc.",{"type":15,"tag":106,"props":4182,"children":4183},{"style":264},[4184],{"type":20,"value":4185},"Notes",{"type":15,"tag":106,"props":4187,"children":4188},{"style":131},[4189],{"type":20,"value":272},{"type":15,"tag":106,"props":4191,"children":4192},{"style":504},[4193],{"type":20,"value":517},{"type":15,"tag":106,"props":4195,"children":4196},{"style":131},[4197],{"type":20,"value":522},{"type":15,"tag":106,"props":4199,"children":4200},{"style":525},[4201],{"type":20,"value":4202},"f",{"type":15,"tag":106,"props":4204,"children":4205},{"style":113},[4206],{"type":20,"value":533},{"type":15,"tag":106,"props":4208,"children":4209},{"style":131},[4210],{"type":20,"value":4211}," f.",{"type":15,"tag":106,"props":4213,"children":4214},{"style":264},[4215],{"type":20,"value":4216},"CreatorParty",{"type":15,"tag":106,"props":4218,"children":4219},{"style":131},[4220],{"type":20,"value":272},{"type":15,"tag":106,"props":4222,"children":4223},{"style":264},[4224],{"type":20,"value":3919},{"type":15,"tag":106,"props":4226,"children":4227},{"style":113},[4228],{"type":20,"value":361},{"type":15,"tag":106,"props":4230,"children":4231},{"style":131},[4232],{"type":20,"value":4233}," clientID).",{"type":15,"tag":106,"props":4235,"children":4236},{"style":504},[4237],{"type":20,"value":1389},{"type":15,"tag":106,"props":4239,"children":4240},{"style":131},[4241],{"type":20,"value":512},{"type":15,"tag":106,"props":4243,"children":4244},{"style":504},[4245],{"type":20,"value":507},{"type":15,"tag":106,"props":4247,"children":4248},{"style":131},[4249],{"type":20,"value":1394},{"type":15,"tag":16,"props":4251,"children":4252},{},[4253,4255,4261],{"type":20,"value":4254},"but I still receive the ",{"type":15,"tag":102,"props":4256,"children":4258},{"className":4257},[],[4259],{"type":20,"value":4260},"Could not format node 'Value' for execute as SQL.",{"type":20,"value":4262}," error. I know the class is being initialized, because I am passing a ClientID as a parameter to the search method containing the LINQ code.",{"type":15,"tag":2203,"props":4264,"children":4265},{},[4266],{"type":20,"value":2207},{"title":99,"searchDepth":137,"depth":137,"links":4268},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46872.md","comments/client-side-properties-and-any-remote-linq-provider/46872.md","comments/client-side-properties-and-any-remote-linq-provider/46872",{"_path":4273,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":4274,"description":4275,"id":4276,"name":4277,"email":4278,"avatar":4279,"date":4280,"body":4281,"_type":2223,"_id":4304,"_source":2225,"_file":4305,"_stem":4306,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46871","46871","Great lib, thanks!",46871,"Radek","radek.stromsky@gmail.com","https://www.gravatar.com/avatar/193d8d04706cb662a8a6a0d38db6cdd3?r=pg&d=retro","2011-11-07T02:44:34",{"type":12,"children":4282,"toc":4302},[4283,4287,4292,4297],{"type":15,"tag":16,"props":4284,"children":4285},{},[4286],{"type":20,"value":4275},{"type":15,"tag":16,"props":4288,"children":4289},{},[4290],{"type":20,"value":4291},"Unfortunately, I am unable to build it for .NET 3.5, because I am missing ExpressionVisitor class.",{"type":15,"tag":16,"props":4293,"children":4294},{},[4295],{"type":20,"value":4296},"Any suggestions for this one?",{"type":15,"tag":16,"props":4298,"children":4299},{},[4300],{"type":20,"value":4301},"Thanks.",{"title":99,"searchDepth":137,"depth":137,"links":4303},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46871.md","comments/client-side-properties-and-any-remote-linq-provider/46871.md","comments/client-side-properties-and-any-remote-linq-provider/46871",{"_path":4308,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":4309,"description":4310,"id":4311,"name":4312,"email":4313,"avatar":4314,"date":4315,"body":4316,"_type":2223,"_id":4982,"_source":2225,"_file":4983,"_stem":4984,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46445","46445","Good job.",46445,"Fred the frog","frederic.quelennec@cooperindustries.com","https://www.gravatar.com/avatar/aa8170b141838a9025fbda40b379e3d5?r=pg&d=retro","2011-09-23T11:34:41",{"type":12,"children":4317,"toc":4980},[4318,4322,4327,4332,4337,4342,4347,4352,4357,4402,4407,4659,4664,4890,4895,4957,4962,4967,4972,4976],{"type":15,"tag":16,"props":4319,"children":4320},{},[4321],{"type":20,"value":4310},{"type":15,"tag":16,"props":4323,"children":4324},{},[4325],{"type":20,"value":4326},"I easily managed to make it work in a standard way.",{"type":15,"tag":16,"props":4328,"children":4329},{},[4330],{"type":20,"value":4331},"But I hurt myself banging my head on a brick wall. I wish to have two levels of translation and don't seem to be capable of.",{"type":15,"tag":16,"props":4333,"children":4334},{},[4335],{"type":20,"value":4336},"My \"mission\" is to declare the client side property in an interface and having the implementation of the property made in the extension class of the interface so that many entities can expose the new client property.",{"type":15,"tag":16,"props":4338,"children":4339},{},[4340],{"type":20,"value":4341},"One of the trick was to transform the code so that to now accept a method instead of a property as client side (interface extension cannot extend properties if I'm right). That I managed ok, me thinks.",{"type":15,"tag":16,"props":4343,"children":4344},{},[4345],{"type":20,"value":4346},"The second trick that gets me crazy is now I need to implement a second level of client side property so that in the expression of the DefaultTranslationOf, I want to use a second level of client side property so that classes that implement the interface can specify the server side fields to use in the expression. (Hope I am not talking german now).",{"type":15,"tag":16,"props":4348,"children":4349},{},[4350],{"type":20,"value":4351},"So to illustrate",{"type":15,"tag":16,"props":4353,"children":4354},{},[4355],{"type":20,"value":4356},"interface:",{"type":15,"tag":94,"props":4358,"children":4360},{"className":96,"code":4359,"language":98,"meta":99,"style":99},"public interface IDataStatus { Guid StatusId { get; }\n",[4361],{"type":15,"tag":102,"props":4362,"children":4363},{"__ignoreMap":99},[4364],{"type":15,"tag":106,"props":4365,"children":4366},{"class":108,"line":109},[4367,4371,4375,4380,4384,4389,4394,4398],{"type":15,"tag":106,"props":4368,"children":4369},{"style":113},[4370],{"type":20,"value":2129},{"type":15,"tag":106,"props":4372,"children":4373},{"style":119},[4374],{"type":20,"value":3332},{"type":15,"tag":106,"props":4376,"children":4377},{"style":665},[4378],{"type":20,"value":4379}," IDataStatus",{"type":15,"tag":106,"props":4381,"children":4382},{"style":131},[4383],{"type":20,"value":168},{"type":15,"tag":106,"props":4385,"children":4386},{"style":665},[4387],{"type":20,"value":4388},"Guid",{"type":15,"tag":106,"props":4390,"children":4391},{"style":131},[4392],{"type":20,"value":4393}," StatusId { ",{"type":15,"tag":106,"props":4395,"children":4396},{"style":146},[4397],{"type":20,"value":1729},{"type":15,"tag":106,"props":4399,"children":4400},{"style":131},[4401],{"type":20,"value":3363},{"type":15,"tag":16,"props":4403,"children":4404},{},[4405],{"type":20,"value":4406},"InterfaceExtension:",{"type":15,"tag":94,"props":4408,"children":4410},{"className":96,"code":4409,"language":98,"meta":99,"style":99},"public static class DataStatusExtensions {\n    private static readonly CompiledExpression closeStatusExpression = DefaultTranslationOf.Property(e => e.CloseStatus()).Is(e => (e.StatusId == EnumStatusIDs.Closed) || (e.StatusId == EnumStatusIDs.Detached));\n\n    public static Boolean CloseStatus(this IDataStatus dataStatus) {\n        return closeStatusExpression.Evaluate(dataStatus);\n    }\n}\n",[4411],{"type":15,"tag":102,"props":4412,"children":4413},{"__ignoreMap":99},[4414,4438,4573,4580,4623,4645,4652],{"type":15,"tag":106,"props":4415,"children":4416},{"class":108,"line":109},[4417,4421,4425,4429,4434],{"type":15,"tag":106,"props":4418,"children":4419},{"style":113},[4420],{"type":20,"value":2129},{"type":15,"tag":106,"props":4422,"children":4423},{"style":113},[4424],{"type":20,"value":657},{"type":15,"tag":106,"props":4426,"children":4427},{"style":119},[4428],{"type":20,"value":122},{"type":15,"tag":106,"props":4430,"children":4431},{"style":125},[4432],{"type":20,"value":4433}," DataStatusExtensions",{"type":15,"tag":106,"props":4435,"children":4436},{"style":131},[4437],{"type":20,"value":134},{"type":15,"tag":106,"props":4439,"children":4440},{"class":108,"line":137},[4441,4445,4449,4453,4457,4462,4466,4470,4474,4478,4482,4486,4490,4495,4500,4504,4508,4512,4516,4521,4526,4530,4535,4540,4544,4548,4552,4556,4560,4564,4569],{"type":15,"tag":106,"props":4442,"children":4443},{"style":113},[4444],{"type":20,"value":652},{"type":15,"tag":106,"props":4446,"children":4447},{"style":113},[4448],{"type":20,"value":657},{"type":15,"tag":106,"props":4450,"children":4451},{"style":113},[4452],{"type":20,"value":662},{"type":15,"tag":106,"props":4454,"children":4455},{"style":665},[4456],{"type":20,"value":668},{"type":15,"tag":106,"props":4458,"children":4459},{"style":131},[4460],{"type":20,"value":4461}," closeStatusExpression ",{"type":15,"tag":106,"props":4463,"children":4464},{"style":113},[4465],{"type":20,"value":487},{"type":15,"tag":106,"props":4467,"children":4468},{"style":131},[4469],{"type":20,"value":2461},{"type":15,"tag":106,"props":4471,"children":4472},{"style":504},[4473],{"type":20,"value":720},{"type":15,"tag":106,"props":4475,"children":4476},{"style":131},[4477],{"type":20,"value":522},{"type":15,"tag":106,"props":4479,"children":4480},{"style":525},[4481],{"type":20,"value":528},{"type":15,"tag":106,"props":4483,"children":4484},{"style":113},[4485],{"type":20,"value":533},{"type":15,"tag":106,"props":4487,"children":4488},{"style":131},[4489],{"type":20,"value":538},{"type":15,"tag":106,"props":4491,"children":4492},{"style":504},[4493],{"type":20,"value":4494},"CloseStatus",{"type":15,"tag":106,"props":4496,"children":4497},{"style":131},[4498],{"type":20,"value":4499},"()).",{"type":15,"tag":106,"props":4501,"children":4502},{"style":504},[4503],{"type":20,"value":750},{"type":15,"tag":106,"props":4505,"children":4506},{"style":131},[4507],{"type":20,"value":522},{"type":15,"tag":106,"props":4509,"children":4510},{"style":525},[4511],{"type":20,"value":528},{"type":15,"tag":106,"props":4513,"children":4514},{"style":113},[4515],{"type":20,"value":533},{"type":15,"tag":106,"props":4517,"children":4518},{"style":131},[4519],{"type":20,"value":4520}," (e.",{"type":15,"tag":106,"props":4522,"children":4523},{"style":264},[4524],{"type":20,"value":4525},"StatusId",{"type":15,"tag":106,"props":4527,"children":4528},{"style":113},[4529],{"type":20,"value":361},{"type":15,"tag":106,"props":4531,"children":4532},{"style":131},[4533],{"type":20,"value":4534}," EnumStatusIDs.",{"type":15,"tag":106,"props":4536,"children":4537},{"style":264},[4538],{"type":20,"value":4539},"Closed",{"type":15,"tag":106,"props":4541,"children":4542},{"style":131},[4543],{"type":20,"value":408},{"type":15,"tag":106,"props":4545,"children":4546},{"style":113},[4547],{"type":20,"value":1007},{"type":15,"tag":106,"props":4549,"children":4550},{"style":131},[4551],{"type":20,"value":4520},{"type":15,"tag":106,"props":4553,"children":4554},{"style":264},[4555],{"type":20,"value":4525},{"type":15,"tag":106,"props":4557,"children":4558},{"style":113},[4559],{"type":20,"value":361},{"type":15,"tag":106,"props":4561,"children":4562},{"style":131},[4563],{"type":20,"value":4534},{"type":15,"tag":106,"props":4565,"children":4566},{"style":264},[4567],{"type":20,"value":4568},"Detached",{"type":15,"tag":106,"props":4570,"children":4571},{"style":131},[4572],{"type":20,"value":434},{"type":15,"tag":106,"props":4574,"children":4575},{"class":108,"line":157},[4576],{"type":15,"tag":106,"props":4577,"children":4578},{"emptyLinePlaceholder":219},[4579],{"type":20,"value":222},{"type":15,"tag":106,"props":4581,"children":4582},{"class":108,"line":206},[4583,4587,4591,4596,4601,4605,4609,4613,4618],{"type":15,"tag":106,"props":4584,"children":4585},{"style":113},[4586],{"type":20,"value":1715},{"type":15,"tag":106,"props":4588,"children":4589},{"style":113},[4590],{"type":20,"value":657},{"type":15,"tag":106,"props":4592,"children":4593},{"style":665},[4594],{"type":20,"value":4595}," Boolean",{"type":15,"tag":106,"props":4597,"children":4598},{"style":504},[4599],{"type":20,"value":4600}," CloseStatus",{"type":15,"tag":106,"props":4602,"children":4603},{"style":131},[4604],{"type":20,"value":522},{"type":15,"tag":106,"props":4606,"children":4607},{"style":113},[4608],{"type":20,"value":1183},{"type":15,"tag":106,"props":4610,"children":4611},{"style":665},[4612],{"type":20,"value":4379},{"type":15,"tag":106,"props":4614,"children":4615},{"style":525},[4616],{"type":20,"value":4617}," dataStatus",{"type":15,"tag":106,"props":4619,"children":4620},{"style":131},[4621],{"type":20,"value":4622},") {\n",{"type":15,"tag":106,"props":4624,"children":4625},{"class":108,"line":215},[4626,4631,4636,4640],{"type":15,"tag":106,"props":4627,"children":4628},{"style":119},[4629],{"type":20,"value":4630},"        return",{"type":15,"tag":106,"props":4632,"children":4633},{"style":131},[4634],{"type":20,"value":4635}," closeStatusExpression.",{"type":15,"tag":106,"props":4637,"children":4638},{"style":504},[4639],{"type":20,"value":1173},{"type":15,"tag":106,"props":4641,"children":4642},{"style":131},[4643],{"type":20,"value":4644},"(dataStatus);\n",{"type":15,"tag":106,"props":4646,"children":4647},{"class":108,"line":225},[4648],{"type":15,"tag":106,"props":4649,"children":4650},{"style":131},[4651],{"type":20,"value":443},{"type":15,"tag":106,"props":4653,"children":4654},{"class":108,"line":243},[4655],{"type":15,"tag":106,"props":4656,"children":4657},{"style":131},[4658],{"type":20,"value":460},{"type":15,"tag":16,"props":4660,"children":4661},{},[4662],{"type":20,"value":4663},"Now in the derived class:",{"type":15,"tag":94,"props":4665,"children":4667},{"className":96,"code":4666,"language":98,"meta":99,"style":99},"partial class Connection : IDataStatus {\n    private static readonly CompiledExpression statusIdExpression = DefaultTranslationOf.Property(e => e.StatusId).Is(e => (e.EnumConnectionStatusID == null) ? Guid.Empty : e.EnumConnectionStatusID.Value);\n\n    public Guid StatusId { get { return statusIdExpression.Evaluate(this); }\n",[4668],{"type":15,"tag":102,"props":4669,"children":4670},{"__ignoreMap":99},[4671,4700,4834,4841],{"type":15,"tag":106,"props":4672,"children":4673},{"class":108,"line":109},[4674,4678,4682,4687,4691,4696],{"type":15,"tag":106,"props":4675,"children":4676},{"style":113},[4677],{"type":20,"value":116},{"type":15,"tag":106,"props":4679,"children":4680},{"style":119},[4681],{"type":20,"value":122},{"type":15,"tag":106,"props":4683,"children":4684},{"style":125},[4685],{"type":20,"value":4686}," Connection",{"type":15,"tag":106,"props":4688,"children":4689},{"style":131},[4690],{"type":20,"value":3403},{"type":15,"tag":106,"props":4692,"children":4693},{"style":665},[4694],{"type":20,"value":4695},"IDataStatus",{"type":15,"tag":106,"props":4697,"children":4698},{"style":131},[4699],{"type":20,"value":134},{"type":15,"tag":106,"props":4701,"children":4702},{"class":108,"line":137},[4703,4707,4711,4715,4719,4724,4728,4732,4736,4740,4744,4748,4752,4756,4760,4764,4768,4772,4776,4780,4785,4789,4793,4797,4801,4806,4810,4814,4818,4822,4826,4830],{"type":15,"tag":106,"props":4704,"children":4705},{"style":113},[4706],{"type":20,"value":652},{"type":15,"tag":106,"props":4708,"children":4709},{"style":113},[4710],{"type":20,"value":657},{"type":15,"tag":106,"props":4712,"children":4713},{"style":113},[4714],{"type":20,"value":662},{"type":15,"tag":106,"props":4716,"children":4717},{"style":665},[4718],{"type":20,"value":668},{"type":15,"tag":106,"props":4720,"children":4721},{"style":131},[4722],{"type":20,"value":4723}," statusIdExpression ",{"type":15,"tag":106,"props":4725,"children":4726},{"style":113},[4727],{"type":20,"value":487},{"type":15,"tag":106,"props":4729,"children":4730},{"style":131},[4731],{"type":20,"value":2461},{"type":15,"tag":106,"props":4733,"children":4734},{"style":504},[4735],{"type":20,"value":720},{"type":15,"tag":106,"props":4737,"children":4738},{"style":131},[4739],{"type":20,"value":522},{"type":15,"tag":106,"props":4741,"children":4742},{"style":525},[4743],{"type":20,"value":528},{"type":15,"tag":106,"props":4745,"children":4746},{"style":113},[4747],{"type":20,"value":533},{"type":15,"tag":106,"props":4749,"children":4750},{"style":131},[4751],{"type":20,"value":538},{"type":15,"tag":106,"props":4753,"children":4754},{"style":264},[4755],{"type":20,"value":4525},{"type":15,"tag":106,"props":4757,"children":4758},{"style":131},[4759],{"type":20,"value":745},{"type":15,"tag":106,"props":4761,"children":4762},{"style":504},[4763],{"type":20,"value":750},{"type":15,"tag":106,"props":4765,"children":4766},{"style":131},[4767],{"type":20,"value":522},{"type":15,"tag":106,"props":4769,"children":4770},{"style":525},[4771],{"type":20,"value":528},{"type":15,"tag":106,"props":4773,"children":4774},{"style":113},[4775],{"type":20,"value":533},{"type":15,"tag":106,"props":4777,"children":4778},{"style":131},[4779],{"type":20,"value":4520},{"type":15,"tag":106,"props":4781,"children":4782},{"style":264},[4783],{"type":20,"value":4784},"EnumConnectionStatusID",{"type":15,"tag":106,"props":4786,"children":4787},{"style":113},[4788],{"type":20,"value":361},{"type":15,"tag":106,"props":4790,"children":4791},{"style":416},[4792],{"type":20,"value":2527},{"type":15,"tag":106,"props":4794,"children":4795},{"style":131},[4796],{"type":20,"value":408},{"type":15,"tag":106,"props":4798,"children":4799},{"style":113},[4800],{"type":20,"value":413},{"type":15,"tag":106,"props":4802,"children":4803},{"style":131},[4804],{"type":20,"value":4805}," Guid.",{"type":15,"tag":106,"props":4807,"children":4808},{"style":264},[4809],{"type":20,"value":2664},{"type":15,"tag":106,"props":4811,"children":4812},{"style":113},[4813],{"type":20,"value":424},{"type":15,"tag":106,"props":4815,"children":4816},{"style":131},[4817],{"type":20,"value":538},{"type":15,"tag":106,"props":4819,"children":4820},{"style":264},[4821],{"type":20,"value":4784},{"type":15,"tag":106,"props":4823,"children":4824},{"style":131},[4825],{"type":20,"value":272},{"type":15,"tag":106,"props":4827,"children":4828},{"style":264},[4829],{"type":20,"value":942},{"type":15,"tag":106,"props":4831,"children":4832},{"style":131},[4833],{"type":20,"value":607},{"type":15,"tag":106,"props":4835,"children":4836},{"class":108,"line":157},[4837],{"type":15,"tag":106,"props":4838,"children":4839},{"emptyLinePlaceholder":219},[4840],{"type":20,"value":222},{"type":15,"tag":106,"props":4842,"children":4843},{"class":108,"line":206},[4844,4848,4853,4857,4861,4865,4869,4874,4878,4882,4886],{"type":15,"tag":106,"props":4845,"children":4846},{"style":113},[4847],{"type":20,"value":1715},{"type":15,"tag":106,"props":4849,"children":4850},{"style":665},[4851],{"type":20,"value":4852}," Guid",{"type":15,"tag":106,"props":4854,"children":4855},{"style":131},[4856],{"type":20,"value":4393},{"type":15,"tag":106,"props":4858,"children":4859},{"style":146},[4860],{"type":20,"value":1729},{"type":15,"tag":106,"props":4862,"children":4863},{"style":131},[4864],{"type":20,"value":168},{"type":15,"tag":106,"props":4866,"children":4867},{"style":119},[4868],{"type":20,"value":173},{"type":15,"tag":106,"props":4870,"children":4871},{"style":131},[4872],{"type":20,"value":4873}," statusIdExpression.",{"type":15,"tag":106,"props":4875,"children":4876},{"style":504},[4877],{"type":20,"value":1173},{"type":15,"tag":106,"props":4879,"children":4880},{"style":131},[4881],{"type":20,"value":522},{"type":15,"tag":106,"props":4883,"children":4884},{"style":1180},[4885],{"type":20,"value":1183},{"type":15,"tag":106,"props":4887,"children":4888},{"style":131},[4889],{"type":20,"value":1188},{"type":15,"tag":16,"props":4891,"children":4892},{},[4893],{"type":20,"value":4894},"and finally some query method",{"type":15,"tag":94,"props":4896,"children":4898},{"className":96,"code":4897,"language":98,"meta":99,"style":99},"query = query.Where(it => it.CloseStatus()).WithTranslations();\n",[4899],{"type":15,"tag":102,"props":4900,"children":4901},{"__ignoreMap":99},[4902],{"type":15,"tag":106,"props":4903,"children":4904},{"class":108,"line":109},[4905,4910,4914,4919,4923,4927,4932,4936,4941,4945,4949,4953],{"type":15,"tag":106,"props":4906,"children":4907},{"style":131},[4908],{"type":20,"value":4909},"query ",{"type":15,"tag":106,"props":4911,"children":4912},{"style":113},[4913],{"type":20,"value":487},{"type":15,"tag":106,"props":4915,"children":4916},{"style":131},[4917],{"type":20,"value":4918}," query.",{"type":15,"tag":106,"props":4920,"children":4921},{"style":504},[4922],{"type":20,"value":517},{"type":15,"tag":106,"props":4924,"children":4925},{"style":131},[4926],{"type":20,"value":522},{"type":15,"tag":106,"props":4928,"children":4929},{"style":525},[4930],{"type":20,"value":4931},"it",{"type":15,"tag":106,"props":4933,"children":4934},{"style":113},[4935],{"type":20,"value":533},{"type":15,"tag":106,"props":4937,"children":4938},{"style":131},[4939],{"type":20,"value":4940}," it.",{"type":15,"tag":106,"props":4942,"children":4943},{"style":504},[4944],{"type":20,"value":4494},{"type":15,"tag":106,"props":4946,"children":4947},{"style":131},[4948],{"type":20,"value":4499},{"type":15,"tag":106,"props":4950,"children":4951},{"style":504},[4952],{"type":20,"value":1389},{"type":15,"tag":106,"props":4954,"children":4955},{"style":131},[4956],{"type":20,"value":1394},{"type":15,"tag":16,"props":4958,"children":4959},{},[4960],{"type":20,"value":4961},"My thinking is that my problem is that it does not manage to translate a IDataStatus.StatusId because the declaration in the map is a Connection.StatusId...",{"type":15,"tag":16,"props":4963,"children":4964},{},[4965],{"type":20,"value":4966},"What do you think?",{"type":15,"tag":16,"props":4968,"children":4969},{},[4970],{"type":20,"value":4971},"Sorry for the long post but I wished to illustrate my saying.",{"type":15,"tag":16,"props":4973,"children":4974},{},[4975],{"type":20,"value":4301},{"type":15,"tag":2203,"props":4977,"children":4978},{},[4979],{"type":20,"value":2207},{"title":99,"searchDepth":137,"depth":137,"links":4981},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46445.md","comments/client-side-properties-and-any-remote-linq-provider/46445.md","comments/client-side-properties-and-any-remote-linq-provider/46445",{"_path":4986,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":4987,"description":4988,"id":4989,"name":4990,"email":4991,"avatar":4992,"url":4993,"date":4994,"body":4995,"_type":2223,"_id":5003,"_source":2225,"_file":5004,"_stem":5005,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46389","46389","But where are the source?",46389,"the_bmo","bmo@atolcd.com","https://www.gravatar.com/avatar/bef4e0457fc4b2c099b188c37b72cd8f?r=pg&d=retro","https://www.atolcd.com","2011-09-07T06:30:13",{"type":12,"children":4996,"toc":5001},[4997],{"type":15,"tag":16,"props":4998,"children":4999},{},[5000],{"type":20,"value":4988},{"title":99,"searchDepth":137,"depth":137,"links":5002},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46389.md","comments/client-side-properties-and-any-remote-linq-provider/46389.md","comments/client-side-properties-and-any-remote-linq-provider/46389",{"_path":5007,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5008,"description":5009,"id":5010,"name":5011,"email":5012,"avatar":5013,"date":5014,"body":5015,"_type":2223,"_id":5023,"_source":2225,"_file":5024,"_stem":5025,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46345","46345","Thanks! Now it works fine!",46345,"Eros","eros_fratini@msn.com","https://www.gravatar.com/avatar/23ea52b1615730d7dacfaa633996375b?r=pg&d=retro","2011-08-23T07:35:37",{"type":12,"children":5016,"toc":5021},[5017],{"type":15,"tag":16,"props":5018,"children":5019},{},[5020],{"type":20,"value":5009},{"title":99,"searchDepth":137,"depth":137,"links":5022},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46345.md","comments/client-side-properties-and-any-remote-linq-provider/46345.md","comments/client-side-properties-and-any-remote-linq-provider/46345",{"_path":5027,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5028,"description":5029,"id":5030,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":5031,"body":5032,"_type":2223,"_id":5040,"_source":2225,"_file":5041,"_stem":5042,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46344","46344","To create LINQ expressions with strings instead of lambda's check out the DynamicLinq samples in your VS2010 folder (it's in the C# Samples folder inside c:\\Program Files\\Microsoft Visual Studio).",46344,"2011-08-23T07:01:46",{"type":12,"children":5033,"toc":5038},[5034],{"type":15,"tag":16,"props":5035,"children":5036},{},[5037],{"type":20,"value":5029},{"title":99,"searchDepth":137,"depth":137,"links":5039},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46344.md","comments/client-side-properties-and-any-remote-linq-provider/46344.md","comments/client-side-properties-and-any-remote-linq-provider/46344",{"_path":5044,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5045,"description":5046,"id":5047,"name":5011,"email":5012,"avatar":5013,"date":5048,"body":5049,"_type":2223,"_id":5179,"_source":2225,"_file":5180,"_stem":5181,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46342","46342","Very useful article, but I wonder: there is a way to use something like this?",46342,"2011-08-23T06:39:31",{"type":12,"children":5050,"toc":5177},[5051,5055,5163,5168,5173],{"type":15,"tag":16,"props":5052,"children":5053},{},[5054],{"type":20,"value":5046},{"type":15,"tag":94,"props":5056,"children":5058},{"className":96,"code":5057,"language":98,"meta":99,"style":99},"db.Employees.Where(e => e.FullName.Contains(\"da\")).OrderBy(\"it.FullName ASC\").WithTranslations();\n",[5059],{"type":15,"tag":102,"props":5060,"children":5061},{"__ignoreMap":99},[5062],{"type":15,"tag":106,"props":5063,"children":5064},{"class":108,"line":109},[5065,5070,5074,5078,5082,5086,5090,5094,5098,5102,5106,5110,5114,5118,5122,5126,5130,5134,5138,5142,5147,5151,5155,5159],{"type":15,"tag":106,"props":5066,"children":5067},{"style":131},[5068],{"type":20,"value":5069},"db.",{"type":15,"tag":106,"props":5071,"children":5072},{"style":264},[5073],{"type":20,"value":497},{"type":15,"tag":106,"props":5075,"children":5076},{"style":131},[5077],{"type":20,"value":272},{"type":15,"tag":106,"props":5079,"children":5080},{"style":504},[5081],{"type":20,"value":517},{"type":15,"tag":106,"props":5083,"children":5084},{"style":131},[5085],{"type":20,"value":522},{"type":15,"tag":106,"props":5087,"children":5088},{"style":525},[5089],{"type":20,"value":528},{"type":15,"tag":106,"props":5091,"children":5092},{"style":113},[5093],{"type":20,"value":533},{"type":15,"tag":106,"props":5095,"children":5096},{"style":131},[5097],{"type":20,"value":538},{"type":15,"tag":106,"props":5099,"children":5100},{"style":264},[5101],{"type":20,"value":543},{"type":15,"tag":106,"props":5103,"children":5104},{"style":131},[5105],{"type":20,"value":272},{"type":15,"tag":106,"props":5107,"children":5108},{"style":504},[5109],{"type":20,"value":552},{"type":15,"tag":106,"props":5111,"children":5112},{"style":131},[5113],{"type":20,"value":522},{"type":15,"tag":106,"props":5115,"children":5116},{"style":186},[5117],{"type":20,"value":561},{"type":15,"tag":106,"props":5119,"children":5120},{"style":564},[5121],{"type":20,"value":567},{"type":15,"tag":106,"props":5123,"children":5124},{"style":186},[5125],{"type":20,"value":561},{"type":15,"tag":106,"props":5127,"children":5128},{"style":131},[5129],{"type":20,"value":576},{"type":15,"tag":106,"props":5131,"children":5132},{"style":504},[5133],{"type":20,"value":2579},{"type":15,"tag":106,"props":5135,"children":5136},{"style":131},[5137],{"type":20,"value":522},{"type":15,"tag":106,"props":5139,"children":5140},{"style":186},[5141],{"type":20,"value":561},{"type":15,"tag":106,"props":5143,"children":5144},{"style":564},[5145],{"type":20,"value":5146},"it.FullName ASC",{"type":15,"tag":106,"props":5148,"children":5149},{"style":186},[5150],{"type":20,"value":561},{"type":15,"tag":106,"props":5152,"children":5153},{"style":131},[5154],{"type":20,"value":745},{"type":15,"tag":106,"props":5156,"children":5157},{"style":504},[5158],{"type":20,"value":1389},{"type":15,"tag":106,"props":5160,"children":5161},{"style":131},[5162],{"type":20,"value":1394},{"type":15,"tag":16,"props":5164,"children":5165},{},[5166],{"type":20,"value":5167},"I need a way to build the OrderBy sql string at runtime, also on the custom properties.",{"type":15,"tag":16,"props":5169,"children":5170},{},[5171],{"type":20,"value":5172},"Many thanks!",{"type":15,"tag":2203,"props":5174,"children":5175},{},[5176],{"type":20,"value":2207},{"title":99,"searchDepth":137,"depth":137,"links":5178},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46342.md","comments/client-side-properties-and-any-remote-linq-provider/46342.md","comments/client-side-properties-and-any-remote-linq-provider/46342",{"_path":5183,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5184,"description":5185,"id":5186,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":5187,"body":5188,"_type":2223,"_id":5196,"_source":2225,"_file":5197,"_stem":5198,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46316","46316","You should just be able to grab the source and use it - there are no runtime dependencies on .NET 4.",46316,"2011-08-14T09:09:15",{"type":12,"children":5189,"toc":5194},[5190],{"type":15,"tag":16,"props":5191,"children":5192},{},[5193],{"type":20,"value":5185},{"title":99,"searchDepth":137,"depth":137,"links":5195},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46316.md","comments/client-side-properties-and-any-remote-linq-provider/46316.md","comments/client-side-properties-and-any-remote-linq-provider/46316",{"_path":5200,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5201,"description":5202,"id":5203,"name":4990,"email":4991,"avatar":4992,"url":4993,"date":5204,"body":5205,"_type":2223,"_id":5223,"_source":2225,"_file":5224,"_stem":5225,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/46300","46300","Hello,",46300,"2011-08-11T06:16:28",{"type":12,"children":5206,"toc":5221},[5207,5211,5216],{"type":15,"tag":16,"props":5208,"children":5209},{},[5210],{"type":20,"value":5202},{"type":15,"tag":16,"props":5212,"children":5213},{},[5214],{"type":20,"value":5215},"Does Microsoft.Linq.Translations exist for 3.5 SP1 ?\nMy project is a vs2008 project ( no nuget )  :(",{"type":15,"tag":16,"props":5217,"children":5218},{},[5219],{"type":20,"value":5220},"bmo",{"title":99,"searchDepth":137,"depth":137,"links":5222},[],"content:comments:client-side-properties-and-any-remote-linq-provider:46300.md","comments/client-side-properties-and-any-remote-linq-provider/46300.md","comments/client-side-properties-and-any-remote-linq-provider/46300",{"_path":5227,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5228,"description":5229,"id":5230,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":5231,"body":5232,"_type":2223,"_id":5240,"_source":2225,"_file":5241,"_stem":5242,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/45267","45267","The Auto class was removed - it was very troublesome and had some issues.",45267,"2011-04-15T11:47:52",{"type":12,"children":5233,"toc":5238},[5234],{"type":15,"tag":16,"props":5235,"children":5236},{},[5237],{"type":20,"value":5229},{"title":99,"searchDepth":137,"depth":137,"links":5239},[],"content:comments:client-side-properties-and-any-remote-linq-provider:45267.md","comments/client-side-properties-and-any-remote-linq-provider/45267.md","comments/client-side-properties-and-any-remote-linq-provider/45267",{"_path":5244,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5245,"description":5246,"id":5247,"name":3279,"email":5248,"avatar":5249,"date":5250,"body":5251,"_type":2223,"_id":5259,"_source":2225,"_file":5260,"_stem":5261,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/45257","45257","Hello, great lib!\nOnly one problem: I installed 1.0.1 via NuGet, but I don't have the .Auto namespace at all. Any clues?",45257,"pohl@al-c.de","https://www.gravatar.com/avatar/f331d23123db5014e4b249c2b3184af4?r=pg&d=retro","2011-04-15T07:09:13",{"type":12,"children":5252,"toc":5257},[5253],{"type":15,"tag":16,"props":5254,"children":5255},{},[5256],{"type":20,"value":5246},{"title":99,"searchDepth":137,"depth":137,"links":5258},[],"content:comments:client-side-properties-and-any-remote-linq-provider:45257.md","comments/client-side-properties-and-any-remote-linq-provider/45257.md","comments/client-side-properties-and-any-remote-linq-provider/45257",{"_path":5263,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5264,"description":5265,"id":5266,"name":5267,"email":5268,"avatar":5269,"date":5270,"body":5271,"_type":2223,"_id":5284,"_source":2225,"_file":5285,"_stem":5286,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/44798","44798","Thanks for the pointers Damien. I examined the trees and could see the differences, but I'm not sure that the translation can be done. The include paths are in a ConstantExpression which is of an internal type System.Data.Objects.Span, so i can't inspect it and see what the paths actually are. Of course it is possible that I don't know enough about this stuff to do it.",44798,"Sean","sean.daly@wisegroup.co.nz","https://www.gravatar.com/avatar/a96374c2bc17abb2a5b2466d1fe15830?r=pg&d=retro","2011-03-22T13:30:08",{"type":12,"children":5272,"toc":5282},[5273,5277],{"type":15,"tag":16,"props":5274,"children":5275},{},[5276],{"type":20,"value":5265},{"type":15,"tag":16,"props":5278,"children":5279},{},[5280],{"type":20,"value":5281},"Anyway, what I'll probably do is create my own Include extension method and do the translations there.",{"title":99,"searchDepth":137,"depth":137,"links":5283},[],"content:comments:client-side-properties-and-any-remote-linq-provider:44798.md","comments/client-side-properties-and-any-remote-linq-provider/44798.md","comments/client-side-properties-and-any-remote-linq-provider/44798",{"_path":5288,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5289,"description":5290,"id":5291,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":5292,"body":5293,"_type":2223,"_id":5311,"_source":2225,"_file":5312,"_stem":5313,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/44789","44789","I'm not sure but can give you some pointers on how to figure it out (if possible).",44789,"2011-03-21T18:01:35",{"type":12,"children":5294,"toc":5309},[5295,5299,5304],{"type":15,"tag":16,"props":5296,"children":5297},{},[5298],{"type":20,"value":5290},{"type":15,"tag":16,"props":5300,"children":5301},{},[5302],{"type":20,"value":5303},"What you'll want to do is write two queries - the one you have above and another that has .Include(e => e.ProtectedThings) and then examine the two trees.",{"type":15,"tag":16,"props":5305,"children":5306},{},[5307],{"type":20,"value":5308},"It's probably the WithTranslations not recognizing the particular pattern that Include uses and is therefore not substituting it correctly. Once you see the difference it shouldn't be too hard to compensate for it.",{"title":99,"searchDepth":137,"depth":137,"links":5310},[],"content:comments:client-side-properties-and-any-remote-linq-provider:44789.md","comments/client-side-properties-and-any-remote-linq-provider/44789.md","comments/client-side-properties-and-any-remote-linq-provider/44789",{"_path":5315,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5316,"description":5317,"id":5318,"name":5267,"email":5268,"avatar":5269,"date":5319,"body":5320,"_type":2223,"_id":5776,"_source":2225,"_file":5777,"_stem":5778,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/44787","44787","I really like this. Is there any way to do something similar with Include paths in an EF query?",44787,"2011-03-21T17:10:02",{"type":12,"children":5321,"toc":5774},[5322,5326,5765,5770],{"type":15,"tag":16,"props":5323,"children":5324},{},[5325],{"type":20,"value":5317},{"type":15,"tag":94,"props":5327,"children":5329},{"className":96,"code":5328,"language":98,"meta":99,"style":99},"public class Employee {\n    private static readonly CompiledExpression\u003CEmployee,IEnumerable> thingsExpression =\n        DefaultTranslationOf.Property(e => e.Things).Is(e => e.ProtectedThings);\n\n    public int Id { get; set; }\n    protected ICollection ProtectedThings { get; set; }\n    public IEnumerable Things {\n        get { return thingsExpressions.Evaluate(this); }\n    }\n}\n\nvar employees = db.Employees\n    .Include(e => e.Things)\n    .Where(e => e.Things.Any(t => true))\n    .WithTranslations()\n    .ToArray();\n",[5330],{"type":15,"tag":102,"props":5331,"children":5332},{"__ignoreMap":99},[5333,5352,5398,5464,5471,5503,5537,5554,5590,5597,5604,5611,5635,5671,5734,5750],{"type":15,"tag":106,"props":5334,"children":5335},{"class":108,"line":109},[5336,5340,5344,5348],{"type":15,"tag":106,"props":5337,"children":5338},{"style":113},[5339],{"type":20,"value":2129},{"type":15,"tag":106,"props":5341,"children":5342},{"style":119},[5343],{"type":20,"value":122},{"type":15,"tag":106,"props":5345,"children":5346},{"style":125},[5347],{"type":20,"value":128},{"type":15,"tag":106,"props":5349,"children":5350},{"style":131},[5351],{"type":20,"value":134},{"type":15,"tag":106,"props":5353,"children":5354},{"class":108,"line":137},[5355,5359,5363,5367,5371,5375,5379,5383,5388,5393],{"type":15,"tag":106,"props":5356,"children":5357},{"style":113},[5358],{"type":20,"value":652},{"type":15,"tag":106,"props":5360,"children":5361},{"style":113},[5362],{"type":20,"value":657},{"type":15,"tag":106,"props":5364,"children":5365},{"style":113},[5366],{"type":20,"value":662},{"type":15,"tag":106,"props":5368,"children":5369},{"style":665},[5370],{"type":20,"value":668},{"type":15,"tag":106,"props":5372,"children":5373},{"style":131},[5374],{"type":20,"value":673},{"type":15,"tag":106,"props":5376,"children":5377},{"style":665},[5378],{"type":20,"value":678},{"type":15,"tag":106,"props":5380,"children":5381},{"style":131},[5382],{"type":20,"value":683},{"type":15,"tag":106,"props":5384,"children":5385},{"style":665},[5386],{"type":20,"value":5387},"IEnumerable",{"type":15,"tag":106,"props":5389,"children":5390},{"style":131},[5391],{"type":20,"value":5392},"> thingsExpression ",{"type":15,"tag":106,"props":5394,"children":5395},{"style":113},[5396],{"type":20,"value":5397},"=\n",{"type":15,"tag":106,"props":5399,"children":5400},{"class":108,"line":157},[5401,5406,5410,5414,5418,5422,5426,5431,5435,5439,5443,5447,5451,5455,5460],{"type":15,"tag":106,"props":5402,"children":5403},{"style":131},[5404],{"type":20,"value":5405},"        DefaultTranslationOf.",{"type":15,"tag":106,"props":5407,"children":5408},{"style":504},[5409],{"type":20,"value":720},{"type":15,"tag":106,"props":5411,"children":5412},{"style":131},[5413],{"type":20,"value":522},{"type":15,"tag":106,"props":5415,"children":5416},{"style":525},[5417],{"type":20,"value":528},{"type":15,"tag":106,"props":5419,"children":5420},{"style":113},[5421],{"type":20,"value":533},{"type":15,"tag":106,"props":5423,"children":5424},{"style":131},[5425],{"type":20,"value":538},{"type":15,"tag":106,"props":5427,"children":5428},{"style":264},[5429],{"type":20,"value":5430},"Things",{"type":15,"tag":106,"props":5432,"children":5433},{"style":131},[5434],{"type":20,"value":745},{"type":15,"tag":106,"props":5436,"children":5437},{"style":504},[5438],{"type":20,"value":750},{"type":15,"tag":106,"props":5440,"children":5441},{"style":131},[5442],{"type":20,"value":522},{"type":15,"tag":106,"props":5444,"children":5445},{"style":525},[5446],{"type":20,"value":528},{"type":15,"tag":106,"props":5448,"children":5449},{"style":113},[5450],{"type":20,"value":533},{"type":15,"tag":106,"props":5452,"children":5453},{"style":131},[5454],{"type":20,"value":538},{"type":15,"tag":106,"props":5456,"children":5457},{"style":264},[5458],{"type":20,"value":5459},"ProtectedThings",{"type":15,"tag":106,"props":5461,"children":5462},{"style":131},[5463],{"type":20,"value":607},{"type":15,"tag":106,"props":5465,"children":5466},{"class":108,"line":206},[5467],{"type":15,"tag":106,"props":5468,"children":5469},{"emptyLinePlaceholder":219},[5470],{"type":20,"value":222},{"type":15,"tag":106,"props":5472,"children":5473},{"class":108,"line":215},[5474,5478,5482,5487,5491,5495,5499],{"type":15,"tag":106,"props":5475,"children":5476},{"style":113},[5477],{"type":20,"value":1715},{"type":15,"tag":106,"props":5479,"children":5480},{"style":146},[5481],{"type":20,"value":235},{"type":15,"tag":106,"props":5483,"children":5484},{"style":131},[5485],{"type":20,"value":5486}," Id { ",{"type":15,"tag":106,"props":5488,"children":5489},{"style":146},[5490],{"type":20,"value":1729},{"type":15,"tag":106,"props":5492,"children":5493},{"style":131},[5494],{"type":20,"value":3577},{"type":15,"tag":106,"props":5496,"children":5497},{"style":146},[5498],{"type":20,"value":3582},{"type":15,"tag":106,"props":5500,"children":5501},{"style":131},[5502],{"type":20,"value":3363},{"type":15,"tag":106,"props":5504,"children":5505},{"class":108,"line":225},[5506,5511,5516,5521,5525,5529,5533],{"type":15,"tag":106,"props":5507,"children":5508},{"style":113},[5509],{"type":20,"value":5510},"    protected",{"type":15,"tag":106,"props":5512,"children":5513},{"style":665},[5514],{"type":20,"value":5515}," ICollection",{"type":15,"tag":106,"props":5517,"children":5518},{"style":131},[5519],{"type":20,"value":5520}," ProtectedThings { ",{"type":15,"tag":106,"props":5522,"children":5523},{"style":146},[5524],{"type":20,"value":1729},{"type":15,"tag":106,"props":5526,"children":5527},{"style":131},[5528],{"type":20,"value":3577},{"type":15,"tag":106,"props":5530,"children":5531},{"style":146},[5532],{"type":20,"value":3582},{"type":15,"tag":106,"props":5534,"children":5535},{"style":131},[5536],{"type":20,"value":3363},{"type":15,"tag":106,"props":5538,"children":5539},{"class":108,"line":243},[5540,5544,5549],{"type":15,"tag":106,"props":5541,"children":5542},{"style":113},[5543],{"type":20,"value":1715},{"type":15,"tag":106,"props":5545,"children":5546},{"style":665},[5547],{"type":20,"value":5548}," IEnumerable",{"type":15,"tag":106,"props":5550,"children":5551},{"style":131},[5552],{"type":20,"value":5553}," Things {\n",{"type":15,"tag":106,"props":5555,"children":5556},{"class":108,"line":334},[5557,5561,5565,5569,5574,5578,5582,5586],{"type":15,"tag":106,"props":5558,"children":5559},{"style":146},[5560],{"type":20,"value":3822},{"type":15,"tag":106,"props":5562,"children":5563},{"style":131},[5564],{"type":20,"value":168},{"type":15,"tag":106,"props":5566,"children":5567},{"style":119},[5568],{"type":20,"value":173},{"type":15,"tag":106,"props":5570,"children":5571},{"style":131},[5572],{"type":20,"value":5573}," thingsExpressions.",{"type":15,"tag":106,"props":5575,"children":5576},{"style":504},[5577],{"type":20,"value":1173},{"type":15,"tag":106,"props":5579,"children":5580},{"style":131},[5581],{"type":20,"value":522},{"type":15,"tag":106,"props":5583,"children":5584},{"style":1180},[5585],{"type":20,"value":1183},{"type":15,"tag":106,"props":5587,"children":5588},{"style":131},[5589],{"type":20,"value":1188},{"type":15,"tag":106,"props":5591,"children":5592},{"class":108,"line":437},[5593],{"type":15,"tag":106,"props":5594,"children":5595},{"style":131},[5596],{"type":20,"value":443},{"type":15,"tag":106,"props":5598,"children":5599},{"class":108,"line":446},[5600],{"type":15,"tag":106,"props":5601,"children":5602},{"style":131},[5603],{"type":20,"value":460},{"type":15,"tag":106,"props":5605,"children":5606},{"class":108,"line":454},[5607],{"type":15,"tag":106,"props":5608,"children":5609},{"emptyLinePlaceholder":219},[5610],{"type":20,"value":222},{"type":15,"tag":106,"props":5612,"children":5613},{"class":108,"line":463},[5614,5618,5622,5626,5630],{"type":15,"tag":106,"props":5615,"children":5616},{"style":146},[5617],{"type":20,"value":477},{"type":15,"tag":106,"props":5619,"children":5620},{"style":131},[5621],{"type":20,"value":482},{"type":15,"tag":106,"props":5623,"children":5624},{"style":113},[5625],{"type":20,"value":487},{"type":15,"tag":106,"props":5627,"children":5628},{"style":131},[5629],{"type":20,"value":492},{"type":15,"tag":106,"props":5631,"children":5632},{"style":264},[5633],{"type":20,"value":5634},"Employees\n",{"type":15,"tag":106,"props":5636,"children":5637},{"class":108,"line":471},[5638,5643,5647,5651,5655,5659,5663,5667],{"type":15,"tag":106,"props":5639,"children":5640},{"style":131},[5641],{"type":20,"value":5642},"    .",{"type":15,"tag":106,"props":5644,"children":5645},{"style":504},[5646],{"type":20,"value":2305},{"type":15,"tag":106,"props":5648,"children":5649},{"style":131},[5650],{"type":20,"value":522},{"type":15,"tag":106,"props":5652,"children":5653},{"style":525},[5654],{"type":20,"value":528},{"type":15,"tag":106,"props":5656,"children":5657},{"style":113},[5658],{"type":20,"value":533},{"type":15,"tag":106,"props":5660,"children":5661},{"style":131},[5662],{"type":20,"value":538},{"type":15,"tag":106,"props":5664,"children":5665},{"style":264},[5666],{"type":20,"value":5430},{"type":15,"tag":106,"props":5668,"children":5669},{"style":131},[5670],{"type":20,"value":331},{"type":15,"tag":106,"props":5672,"children":5673},{"class":108,"line":1263},[5674,5678,5682,5686,5690,5694,5698,5702,5706,5711,5715,5720,5724,5729],{"type":15,"tag":106,"props":5675,"children":5676},{"style":131},[5677],{"type":20,"value":5642},{"type":15,"tag":106,"props":5679,"children":5680},{"style":504},[5681],{"type":20,"value":517},{"type":15,"tag":106,"props":5683,"children":5684},{"style":131},[5685],{"type":20,"value":522},{"type":15,"tag":106,"props":5687,"children":5688},{"style":525},[5689],{"type":20,"value":528},{"type":15,"tag":106,"props":5691,"children":5692},{"style":113},[5693],{"type":20,"value":533},{"type":15,"tag":106,"props":5695,"children":5696},{"style":131},[5697],{"type":20,"value":538},{"type":15,"tag":106,"props":5699,"children":5700},{"style":264},[5701],{"type":20,"value":5430},{"type":15,"tag":106,"props":5703,"children":5704},{"style":131},[5705],{"type":20,"value":272},{"type":15,"tag":106,"props":5707,"children":5708},{"style":504},[5709],{"type":20,"value":5710},"Any",{"type":15,"tag":106,"props":5712,"children":5713},{"style":131},[5714],{"type":20,"value":522},{"type":15,"tag":106,"props":5716,"children":5717},{"style":525},[5718],{"type":20,"value":5719},"t",{"type":15,"tag":106,"props":5721,"children":5722},{"style":113},[5723],{"type":20,"value":533},{"type":15,"tag":106,"props":5725,"children":5726},{"style":416},[5727],{"type":20,"value":5728}," true",{"type":15,"tag":106,"props":5730,"children":5731},{"style":131},[5732],{"type":20,"value":5733},"))\n",{"type":15,"tag":106,"props":5735,"children":5736},{"class":108,"line":1271},[5737,5741,5745],{"type":15,"tag":106,"props":5738,"children":5739},{"style":131},[5740],{"type":20,"value":5642},{"type":15,"tag":106,"props":5742,"children":5743},{"style":504},[5744],{"type":20,"value":1389},{"type":15,"tag":106,"props":5746,"children":5747},{"style":131},[5748],{"type":20,"value":5749},"()\n",{"type":15,"tag":106,"props":5751,"children":5752},{"class":108,"line":1279},[5753,5757,5761],{"type":15,"tag":106,"props":5754,"children":5755},{"style":131},[5756],{"type":20,"value":5642},{"type":15,"tag":106,"props":5758,"children":5759},{"style":504},[5760],{"type":20,"value":2641},{"type":15,"tag":106,"props":5762,"children":5763},{"style":131},[5764],{"type":20,"value":1394},{"type":15,"tag":16,"props":5766,"children":5767},{},[5768],{"type":20,"value":5769},"The EF LINQ provider blows up when trying to do the Include.",{"type":15,"tag":2203,"props":5771,"children":5772},{},[5773],{"type":20,"value":2207},{"title":99,"searchDepth":137,"depth":137,"links":5775},[],"content:comments:client-side-properties-and-any-remote-linq-provider:44787.md","comments/client-side-properties-and-any-remote-linq-provider/44787.md","comments/client-side-properties-and-any-remote-linq-provider/44787",{"_path":5780,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5781,"description":5782,"id":5783,"name":5784,"email":5785,"avatar":5786,"date":5787,"body":5788,"_type":2223,"_id":5967,"_source":2225,"_file":5968,"_stem":5969,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/43993","43993","As a naive solution to @Matyas Boros's problem I've added the following code to my DataContext class:",43993,"AaronSieb","asiebersma@gmail.com","https://www.gravatar.com/avatar/c37807d027f6d12279174e48f2013964?r=pg&d=retro","2011-01-12T15:49:45",{"type":12,"children":5789,"toc":5965},[5790,5794,5951,5956,5961],{"type":15,"tag":16,"props":5791,"children":5792},{},[5793],{"type":20,"value":5782},{"type":15,"tag":94,"props":5795,"children":5797},{"className":96,"code":5796,"language":98,"meta":99,"style":99},"static WikiTomeDataContext() {\n    Assembly currentAssembly = Assembly.GetExecutingAssembly();\n    foreach(var type in currentAssembly.GetExportedTypes())\n       System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(type.TypeHandle);\n}\n",[5798],{"type":15,"tag":102,"props":5799,"children":5800},{"__ignoreMap":99},[5801,5819,5850,5890,5944],{"type":15,"tag":106,"props":5802,"children":5803},{"class":108,"line":109},[5804,5809,5814],{"type":15,"tag":106,"props":5805,"children":5806},{"style":113},[5807],{"type":20,"value":5808},"static",{"type":15,"tag":106,"props":5810,"children":5811},{"style":504},[5812],{"type":20,"value":5813}," WikiTomeDataContext",{"type":15,"tag":106,"props":5815,"children":5816},{"style":131},[5817],{"type":20,"value":5818},"() {\n",{"type":15,"tag":106,"props":5820,"children":5821},{"class":108,"line":137},[5822,5827,5832,5836,5841,5846],{"type":15,"tag":106,"props":5823,"children":5824},{"style":665},[5825],{"type":20,"value":5826},"    Assembly",{"type":15,"tag":106,"props":5828,"children":5829},{"style":131},[5830],{"type":20,"value":5831}," currentAssembly ",{"type":15,"tag":106,"props":5833,"children":5834},{"style":113},[5835],{"type":20,"value":487},{"type":15,"tag":106,"props":5837,"children":5838},{"style":131},[5839],{"type":20,"value":5840}," Assembly.",{"type":15,"tag":106,"props":5842,"children":5843},{"style":504},[5844],{"type":20,"value":5845},"GetExecutingAssembly",{"type":15,"tag":106,"props":5847,"children":5848},{"style":131},[5849],{"type":20,"value":1394},{"type":15,"tag":106,"props":5851,"children":5852},{"class":108,"line":157},[5853,5858,5862,5866,5871,5875,5880,5885],{"type":15,"tag":106,"props":5854,"children":5855},{"style":119},[5856],{"type":20,"value":5857},"    foreach",{"type":15,"tag":106,"props":5859,"children":5860},{"style":131},[5861],{"type":20,"value":522},{"type":15,"tag":106,"props":5863,"children":5864},{"style":146},[5865],{"type":20,"value":477},{"type":15,"tag":106,"props":5867,"children":5868},{"style":131},[5869],{"type":20,"value":5870}," type ",{"type":15,"tag":106,"props":5872,"children":5873},{"style":119},[5874],{"type":20,"value":1987},{"type":15,"tag":106,"props":5876,"children":5877},{"style":131},[5878],{"type":20,"value":5879}," currentAssembly.",{"type":15,"tag":106,"props":5881,"children":5882},{"style":504},[5883],{"type":20,"value":5884},"GetExportedTypes",{"type":15,"tag":106,"props":5886,"children":5887},{"style":131},[5888],{"type":20,"value":5889},"())\n",{"type":15,"tag":106,"props":5891,"children":5892},{"class":108,"line":206},[5893,5898,5903,5907,5912,5916,5921,5925,5930,5935,5940],{"type":15,"tag":106,"props":5894,"children":5895},{"style":131},[5896],{"type":20,"value":5897},"       System.",{"type":15,"tag":106,"props":5899,"children":5900},{"style":264},[5901],{"type":20,"value":5902},"Runtime",{"type":15,"tag":106,"props":5904,"children":5905},{"style":131},[5906],{"type":20,"value":272},{"type":15,"tag":106,"props":5908,"children":5909},{"style":264},[5910],{"type":20,"value":5911},"CompilerServices",{"type":15,"tag":106,"props":5913,"children":5914},{"style":131},[5915],{"type":20,"value":272},{"type":15,"tag":106,"props":5917,"children":5918},{"style":264},[5919],{"type":20,"value":5920},"RuntimeHelpers",{"type":15,"tag":106,"props":5922,"children":5923},{"style":131},[5924],{"type":20,"value":272},{"type":15,"tag":106,"props":5926,"children":5927},{"style":504},[5928],{"type":20,"value":5929},"RunClassConstructor",{"type":15,"tag":106,"props":5931,"children":5932},{"style":131},[5933],{"type":20,"value":5934},"(type.",{"type":15,"tag":106,"props":5936,"children":5937},{"style":264},[5938],{"type":20,"value":5939},"TypeHandle",{"type":15,"tag":106,"props":5941,"children":5942},{"style":131},[5943],{"type":20,"value":607},{"type":15,"tag":106,"props":5945,"children":5946},{"class":108,"line":215},[5947],{"type":15,"tag":106,"props":5948,"children":5949},{"style":131},[5950],{"type":20,"value":460},{"type":15,"tag":16,"props":5952,"children":5953},{},[5954],{"type":20,"value":5955},"This ensures that all of your classes are in the same assembly as your data context.",{"type":15,"tag":16,"props":5957,"children":5958},{},[5959],{"type":20,"value":5960},"It works in small-scale tests on my dev machine, but I haven't tested it for performance yet.",{"type":15,"tag":2203,"props":5962,"children":5963},{},[5964],{"type":20,"value":2207},{"title":99,"searchDepth":137,"depth":137,"links":5966},[],"content:comments:client-side-properties-and-any-remote-linq-provider:43993.md","comments/client-side-properties-and-any-remote-linq-provider/43993.md","comments/client-side-properties-and-any-remote-linq-provider/43993",{"_path":5971,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":5972,"description":5973,"id":5974,"name":5975,"email":5976,"avatar":5977,"date":5978,"body":5979,"_type":2223,"_id":6015,"_source":2225,"_file":6016,"_stem":6017,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/42324","42324","@David: You can create the missing extension methods easily by hand, and then not use the original System.Linq ones. You have the examples in the AutoTranslation.cs file. There is no magic, each one is 1 line. I agree that in the next update these should be included by default,",42324,"Matyas Boros","matyas@borosit.com","https://www.gravatar.com/avatar/dbc253cfc535483c6dfdbf89bc3e9ac4?r=pg&d=retro","2010-08-30T16:16:37",{"type":12,"children":5980,"toc":6013},[5981,5985,5998,6003,6008],{"type":15,"tag":16,"props":5982,"children":5983},{},[5984],{"type":20,"value":5973},{"type":15,"tag":16,"props":5986,"children":5987},{},[5988,5990,5996],{"type":20,"value":5989},"My problem is a bit different as the ",{"type":15,"tag":102,"props":5991,"children":5993},{"className":5992},[],[5994],{"type":20,"value":5995},"typeof(MyClass).ToString()",{"type":20,"value":5997}," does not initialize the static fields.",{"type":15,"tag":16,"props":5999,"children":6000},{},[6001],{"type":20,"value":6002},"Checking the C# language specification for 3.0 (point 10.5.5.1 Static field initialization), the static field is initialized before it's access (what can be too late in our case if there is an sql query executed with this property usage), or before the static constructor. The static constructor is called when a static field is accessed, or an instance is created. So for this to work properly, we have to make sure, that all Entities having such properties have a static constructor (it can be empty), and that a static field is called or an instance is created.",{"type":15,"tag":16,"props":6004,"children":6005},{},[6006],{"type":20,"value":6007},"So find a suitable place that gets called only once, and before any query gets executed (either Global.Application_Start(..) or a surely accessed class's static constructor - in my case my UserControlBase class), and either call a customly defined static field on the entity, or create an instance of it.",{"type":15,"tag":16,"props":6009,"children":6010},{},[6011],{"type":20,"value":6012},"It is quite an ugly workaround, and i would be very interested in any better ones!! Ideas?",{"title":99,"searchDepth":137,"depth":137,"links":6014},[],"content:comments:client-side-properties-and-any-remote-linq-provider:42324.md","comments/client-side-properties-and-any-remote-linq-provider/42324.md","comments/client-side-properties-and-any-remote-linq-provider/42324",{"_path":6019,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":6020,"description":6021,"id":6022,"name":6023,"email":6024,"avatar":6025,"date":6026,"body":6027,"_type":2223,"_id":6035,"_source":2225,"_file":6036,"_stem":6037,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/39466","39466","@David Fowler:\nYes, I was trying to include both namespaces.  I can't omit System.Linq, because that has some other extensions (e.g. First()) that I also need to use.\nEffectively this means that I can't use the Auto translations at all, which is a big pity... :(",39466,"Shaul B","sbehr@sabreton.com","https://www.gravatar.com/avatar/cfd36640b9346a2ec8b635214faedbed?r=pg&d=retro","2010-04-07T07:05:39",{"type":12,"children":6028,"toc":6033},[6029],{"type":15,"tag":16,"props":6030,"children":6031},{},[6032],{"type":20,"value":6021},{"title":99,"searchDepth":137,"depth":137,"links":6034},[],"content:comments:client-side-properties-and-any-remote-linq-provider:39466.md","comments/client-side-properties-and-any-remote-linq-provider/39466.md","comments/client-side-properties-and-any-remote-linq-provider/39466",{"_path":6039,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":6040,"description":6041,"id":6042,"name":21,"email":6043,"avatar":6044,"url":6045,"date":6046,"body":6047,"_type":2223,"_id":6060,"_source":2225,"_file":6061,"_stem":6062,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/38672","38672","@Shaul B",38672,"david.fowler@microsoft.com","https://www.gravatar.com/avatar/9d6161f7a9eaf37fa9df33b656d870b7?r=pg&d=retro","https://weblogs.asp.net/davidfowler","2010-03-24T14:41:27",{"type":12,"children":6048,"toc":6058},[6049,6053],{"type":15,"tag":16,"props":6050,"children":6051},{},[6052],{"type":20,"value":6041},{"type":15,"tag":16,"props":6054,"children":6055},{},[6056],{"type":20,"value":6057},"Do you have both of the namespaces included? (i.e the default Linq namespace and Microsoft.Linq.Translations.Auto) They can't be used together since one overrides the other's behavior and have the same signatures.",{"title":99,"searchDepth":137,"depth":137,"links":6059},[],"content:comments:client-side-properties-and-any-remote-linq-provider:38672.md","comments/client-side-properties-and-any-remote-linq-provider/38672.md","comments/client-side-properties-and-any-remote-linq-provider/38672",{"_path":6064,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":6065,"description":6066,"id":6067,"name":6023,"email":6024,"avatar":6025,"date":6068,"body":6069,"_type":2223,"_id":6077,"_source":2225,"_file":6078,"_stem":6079,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/38562","38562","Very cool, thank you!\nJust one problem - if you include \"using Microsoft.Linq.Translations.Auto;\" it creates an ambiguity with System.Linq.Queryable.Where extension, as well as the System.Linq.Queryable.Contains extension.  How do you work around that?",38562,"2010-03-23T05:35:41",{"type":12,"children":6070,"toc":6075},[6071],{"type":15,"tag":16,"props":6072,"children":6073},{},[6074],{"type":20,"value":6066},{"title":99,"searchDepth":137,"depth":137,"links":6076},[],"content:comments:client-side-properties-and-any-remote-linq-provider:38562.md","comments/client-side-properties-and-any-remote-linq-provider/38562.md","comments/client-side-properties-and-any-remote-linq-provider/38562",{"_path":6081,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":6082,"description":6083,"id":6084,"name":2371,"email":2372,"avatar":2373,"url":2374,"date":6085,"body":6086,"_type":2223,"_id":6103,"_source":2225,"_file":6104,"_stem":6105,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/23501","23501","@BrianP, something simple like typeof(MyClass).ToString(); should cause it to be initialized.",23501,"2009-08-11T22:29:51",{"type":12,"children":6087,"toc":6101},[6088],{"type":15,"tag":16,"props":6089,"children":6090},{},[6091,6093,6099],{"type":20,"value":6092},"@BrianP, something simple like ",{"type":15,"tag":102,"props":6094,"children":6096},{"className":6095},[],[6097],{"type":20,"value":6098},"typeof(MyClass).ToString();",{"type":20,"value":6100}," should cause it to be initialized.",{"title":99,"searchDepth":137,"depth":137,"links":6102},[],"content:comments:client-side-properties-and-any-remote-linq-provider:23501.md","comments/client-side-properties-and-any-remote-linq-provider/23501.md","comments/client-side-properties-and-any-remote-linq-provider/23501",{"_path":6107,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":6108,"description":6109,"id":6110,"name":6111,"email":6112,"avatar":6113,"date":6114,"body":6115,"_type":2223,"_id":6128,"_source":2225,"_file":6129,"_stem":6130,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/19974","19974","\"The caveat to the usage technique shown above is you need to ensure your class has been initialized before you write queries to it. If this is a problem check out the usage considerations section below.\"",19974,"BrianP","brianjpritchard@yahoo.com","https://www.gravatar.com/avatar/d39f15f78e9f15a1cbf53870d1dc56b0?r=pg&d=retro","2009-06-28T13:56:22",{"type":12,"children":6116,"toc":6126},[6117,6121],{"type":15,"tag":16,"props":6118,"children":6119},{},[6120],{"type":20,"value":6109},{"type":15,"tag":16,"props":6122,"children":6123},{},[6124],{"type":20,"value":6125},"I would like to keep the property expressions in the class itself, are there any other recommended ways of ensuring the class gets initialized before querying?",{"title":99,"searchDepth":137,"depth":137,"links":6127},[],"content:comments:client-side-properties-and-any-remote-linq-provider:19974.md","comments/client-side-properties-and-any-remote-linq-provider/19974.md","comments/client-side-properties-and-any-remote-linq-provider/19974",{"_path":6132,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":6133,"description":6134,"id":6135,"name":6111,"email":6112,"avatar":6113,"date":6136,"body":6137,"_type":2223,"_id":6150,"_source":2225,"_file":6151,"_stem":6152,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/19971","19971","This is great! I can't wait to try it out.",19971,"2009-06-28T13:31:35",{"type":12,"children":6138,"toc":6148},[6139,6143],{"type":15,"tag":16,"props":6140,"children":6141},{},[6142],{"type":20,"value":6134},{"type":15,"tag":16,"props":6144,"children":6145},{},[6146],{"type":20,"value":6147},"I agree with shawn, this should be standard part of linq.",{"title":99,"searchDepth":137,"depth":137,"links":6149},[],"content:comments:client-side-properties-and-any-remote-linq-provider:19971.md","comments/client-side-properties-and-any-remote-linq-provider/19971.md","comments/client-side-properties-and-any-remote-linq-provider/19971",{"_path":6154,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":6155,"description":6156,"id":6157,"name":6158,"email":6159,"avatar":6160,"date":6161,"body":6162,"_type":2223,"_id":6170,"_source":2225,"_file":6171,"_stem":6172,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/19833","19833","Nice, now that's what I'm talking about!  Any chance we can get something like this baked into the framework for 4.0? ;)",19833,"shawn","shawnef@tactics.com","https://www.gravatar.com/avatar/7e607cdcdee3b9d226455eae90cb9299?r=pg&d=retro","2009-06-25T16:28:18",{"type":12,"children":6163,"toc":6168},[6164],{"type":15,"tag":16,"props":6165,"children":6166},{},[6167],{"type":20,"value":6156},{"title":99,"searchDepth":137,"depth":137,"links":6169},[],"content:comments:client-side-properties-and-any-remote-linq-provider:19833.md","comments/client-side-properties-and-any-remote-linq-provider/19833.md","comments/client-side-properties-and-any-remote-linq-provider/19833",{"_path":6174,"_dir":2248,"_draft":6,"_partial":6,"_locale":7,"title":6175,"description":6176,"id":6177,"name":6178,"email":6179,"avatar":6180,"url":6181,"date":6182,"body":6183,"_type":2223,"_id":6232,"_source":2225,"_file":6233,"_stem":6234,"_extension":2228},"/comments/client-side-properties-and-any-remote-linq-provider/19777","19777","This is very neat, thanks for the sample & the translation lib. This is at least as handy as System.Linq.Dynamic (which is one of my favorites :) ).",19777,"KristoferA","kristofera@gmail.com","https://www.gravatar.com/avatar/8313d33da9a27377b32079d183b40c6b?r=pg&d=retro","https://blog.huagati.com/","2009-06-24T19:02:46",{"type":12,"children":6184,"toc":6230},[6185,6197,6202],{"type":15,"tag":16,"props":6186,"children":6187},{},[6188,6190,6195],{"type":20,"value":6189},"This is ",{"type":15,"tag":2197,"props":6191,"children":6192},{},[6193],{"type":20,"value":6194},"very",{"type":20,"value":6196}," neat, thanks for the sample & the translation lib. This is at least as handy as System.Linq.Dynamic (which is one of my favorites :) ).",{"type":15,"tag":16,"props":6198,"children":6199},{},[6200],{"type":20,"value":6201},"Just one note though: when used as the only discriminator in a where clause like in the full name example, SQL Server will be unable to use any indexes on the underlying fields. In other words, this is fine to use in projections, as 'non-primary' discriminators, or on small tables/result sets.",{"type":15,"tag":16,"props":6203,"children":6204},{},[6205,6207,6212,6213,6217,6219,6223,6224,6228],{"type":20,"value":6206},"E.g. the fullname where clause will translate to something along the lines:\nWHERE (((",{"type":15,"tag":106,"props":6208,"children":6209},{},[6210],{"type":20,"value":6211},"t0",{"type":20,"value":272},{"type":15,"tag":106,"props":6214,"children":6215},{},[6216],{"type":20,"value":771},{"type":20,"value":6218}," + @p0) + ",{"type":15,"tag":106,"props":6220,"children":6221},{},[6222],{"type":20,"value":6211},{"type":20,"value":272},{"type":15,"tag":106,"props":6225,"children":6226},{},[6227],{"type":20,"value":796},{"type":20,"value":6229},") LIKE @p1)\n...and that basically tells SQL Server to concatenate forename + p0 + surname in all records in the table and then apply the like comparison...",{"title":99,"searchDepth":137,"depth":137,"links":6231},[],"content:comments:client-side-properties-and-any-remote-linq-provider:19777.md","comments/client-side-properties-and-any-remote-linq-provider/19777.md","comments/client-side-properties-and-any-remote-linq-provider/19777",1779264585312]