score:0
Accepted answer
The only thing missing from the code was a working signature.
Expression<Func<Device, Object >> GetLambda()
In my case , SortingDevicesFilters was an enum that - with a proper switch - returns the appropriate filters.
So it is possible to return a linq lambda from a function.
Source: stackoverflow.com
Related Query
- Get custom linq lambda for sorting
- How to get PEX to automatically generate inputs for code involving LINQ
- source code for LINQ 101 samples
- C# Linq Lambda Expression for Entity Framework Query Passing Custom Expression to Where Condition
- LINQ lambda OrderByDescending on group by key.count() returning list of string of group by key for chart legend sorting
- C# LINQ or for loop How to get a data source from a db?
- How can I get LINQ to return the object which has the max value for a given property?
- How to get distinct instance from a list by Lambda or LINQ
- Linq syntax for OrderBy with custom Comparer<T>
- How can you do custom sorting in LINQ with null always on the end?
- Get new indices of items in a collection after sorting using LINQ
- What is equivalent to clause between, for comparasion strings in LINQ or lambda expression of?
- How to get linq `ForEach` statement to return data on the method call being made for each list object?
- Get X random elements from table in database using Linq or lambda in C#
- writing a custom comparer for linq groupby
- Linq .SingleOrDefault - how to setup a default for a custom class?
- Workarounds for using custom methods/extension methods in LINQ to Entities
- How to get in LINQ one row for each key
- How to use C# LINQ Union to get the Union of Custom list1 with list2
- Use Lambda or Linq to create Model of SelectList with Selected item for razor View in MVC5
- Using LINQ to Get Sum/ Average of a List with custom objects
- Suggestions for designing complex LINQ code
- How to reuse a linq expression for 'Where' when using multiple source tables
- Get Value and Count of that value using LINQ or lambda expression
- Expression to get LINQ with Contains to EF for SQL IN() where on entities child's property equals value
- Get current enumerator (iterator ?) in LINQ query. Like a current index in for loops
- Dynamic LINQ Expression for sorting navigation property
- LINQ Source Code Available
- linq - Substitute Non-Generic Lambda Expression for Generic Lambda Expression
- LINQ - C# - Using lambda - Get a set of data from a Collection
More Query from same tag
- Using Linq how I have to add list items
- Result of linq query can be used as reference?
- Linq .GroupBy() with count
- How do I write an edit method for related data
- C# Filter Items In A List According To Multiple Criteria
- What's the difference between FindAll and Select?
- Use .DefaultIfEmpty() instead of .FirstOrDefault() ?? String.Empty;
- Linq object properties disappear after serialization
- Add empty element to list
- LINQ: Getting the row with the maximum value of a given attribute
- get average Datetime from DB and subtract one Date from another
- linq equals override
- Selecting Multiple Rows from DataTable using Linq
- Web Service taking object as parameters
- Linq Query ignore empty parameters
- Remove "duplicate" results with Linq on LEFT OUTER joins
- Query Xml File for Records using Linq
- Get the latest updated sub-directory
- How to use LINQ on a join table?
- I want compare two string and want to get possible matches
- HttpGet HttpPost method deviation
- Linq to Entities versus Linq to Objects Performance Issue
- Linq Where with variable header
- Converting sql statement to lambda to be used in razor page
- How to make lambda do one db call instead of severals
- LINQ - OR two SqlMethods.Like clauses
- How to change synthesized speech voice language UWP?
- Convert datetime2 to string("dd/MM/yyyy") in LINQ
- LINQ: how to aggregate list within object after grouping properties
- How to check if items in collection contains a specific value?