EF Pre Compile query and return of a scalar value
问题 I use asp.net 4 c# and ef4. I have this code, it should compile a query and return a single scalar value (I use anonymous type). My code does not have apparently errors, but because is the first time I write a compiled query I would like to know if is well written or could be improved for a performance boost. var query = CompiledQuery.Compile((CmsConnectionStringEntityDataModel ctx) => from o in ctx.CmsOptions where o.OptionId == 7 select new { Value = o.Value }); uxHtmlHead.Text = query