¡@

Home 

c# Programming Glossary: queryable

Translate Queryable<T> back to IMongoQuery

http://stackoverflow.com/questions/10261156/translate-queryablet-back-to-imongoquery

Queryable T back to IMongoQuery Consider the following code var q from.. Consider the following code var q from e in myCollection.AsQueryable Entity where e.Name test select e The actual query is very complex.. LINQ query I should have known . You have to downcast the IQueryable T to a MongoQueryable T to get access to the GetMongoQuery method..

Web API OData Inlinecount not working

http://stackoverflow.com/questions/15422831/web-api-odata-inlinecount-not-working

public class ValuesController ApiController GET api values Queryable PageSize 1 public IQueryable string Get return new string value1.. ApiController GET api values Queryable PageSize 1 public IQueryable string Get return new string value1 value2 value3 value4 value5.. return new string value1 value2 value3 value4 value5 .AsQueryable When I get http localhost api values inlinecount allpages This..

Using my own method with LINQ to Entities

http://stackoverflow.com/questions/17187395/using-my-own-method-with-linq-to-entities

instead use LINQ to Objects by using Enumerable instead of Queryable note the AsEnumerable in the below code static void GetHaendler..

C# Turning magic string into lambda expression

http://stackoverflow.com/questions/17770114/c-sharp-turning-magic-string-into-lambda-expression

can handle multiple levels deep magic string. For example IQueryable Contact contacts GetContacts contacts.OrderByProperty Name works.. private static readonly MethodInfo OrderByMethod typeof Queryable .GetMethods .Single method method.Name OrderBy method.GetParameters.. static readonly MethodInfo OrderByDescendingMethod typeof Queryable .GetMethods .Single method method.Name OrderByDescending method.GetParameters..

sort columns of gridview in asp.net c#

http://stackoverflow.com/questions/213148/sort-columns-of-gridview-in-asp-net-c-sharp

to sort by SortExpression and SortDirection public static IQueryable T SortBy T IQueryable T source string sortExpression SortDirection.. and SortDirection public static IQueryable T SortBy T IQueryable T source string sortExpression SortDirection direction if source.. paramExp var methodCallExp Expression.Call typeof Queryable methodName new typeof T propExp.Type source.Expression..

How do I apply OrderBy on an IQueryable using a string column name within a generic extension method?

http://stackoverflow.com/questions/307512/how-do-i-apply-orderby-on-an-iqueryable-using-a-string-column-name-within-a-gene

do I apply OrderBy on an IQueryable using a string column name within a generic extension method.. name within a generic extension method public static IQueryable TResult ApplySortFilter T TResult this IQueryable T query string.. static IQueryable TResult ApplySortFilter T TResult this IQueryable T query string columnName where T EntityObject var param Expression.Parameter..

Select Right Generic Method with Reflection

http://stackoverflow.com/questions/3631547/select-right-generic-method-with-reflection

method. For example the static methods in the System.Linq.Queryable class. There are two definitions of the 'Where' method static.. There are two definitions of the 'Where' method static IQueryable T Where this IQueryable T source Expression Func T bool predicate.. of the 'Where' method static IQueryable T Where this IQueryable T source Expression Func T bool predicate static IQueryable..

Declaring Func<in T, out Result> dynamically

http://stackoverflow.com/questions/3752305/declaring-funcin-t-out-result-dynamically

param If you want to call the OrderBy extension method on Queryable things get a little more complicated var propertyInfo typeof.. method with no types specified MethodInfo method typeof Queryable .GetMethods .Where m m.Name OrderBy m.GetParameters .Length.. propertyInfo orderParam how to use var sequence new T 0 .AsQueryable sample IQueryable because no types are known in advance we need..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

ordering. Unfortunately the method included only works on IQueryable T . Is there any way to get this functionality on IEnumerable.. T you could add some wrapper methods that go via AsQueryable but the code below is the core Expression logic needed. public.. is the core Expression logic needed. public static IOrderedQueryable T OrderBy T this IQueryable T source string property return..

Calling a Method from an Expression

http://stackoverflow.com/questions/439172/calling-a-method-from-an-expression

throws an exception No method 'Any' on type 'System.Linq.Queryable' is compatible with the supplied arguments. Here is how I am.. how I am calling Any Expression any Expression.Call typeof Queryable Any new Type tankFunction.Body.Type this should match the delegate..... more clarity on Tank and Vehicle MethodInfo method typeof Queryable .GetMethods .Where m m.Name Any m.GetParameters .Length 2 .Single..

What is the effect of AsEnumerable() on a LINQ Entity?

http://stackoverflow.com/questions/5311034/what-is-the-effect-of-asenumerable-on-a-linq-entity

member resolution find members of Enumerable instead of Queryable . It's usually used when you want to force part of a query to..

How to create LINQ Expression Tree with anonymous type in it

http://stackoverflow.com/questions/606104/how-to-create-linq-expression-tree-with-anonymous-type-in-it

Works good on late bound data controls. public static IQueryable SelectDynamic this IQueryable source IEnumerable string fieldNames.. controls. public static IQueryable SelectDynamic this IQueryable source IEnumerable string fieldNames Dictionary string PropertyInfo.. return source.Provider.CreateQuery Expression.Call typeof Queryable Select new Type source.ElementType dynamicType Expression.Constant..