score:0
// guessing navigation property names here.
query = _context.formfields.include(r => r.form.section.generalform);
// and later in your code
if (criteria.formfieldnames.any())
{
query = query.where(f => criteria.formfieldnames.contains(f.fieldname));
}
Source: stackoverflow.com
Related Query
- LINQ Query - Proper "Where" clause to select only children that meet a condition
- C# - if condition in Linq select query with where clause
- C# linq query to filter out only items of a specified type, that meet a specified condition
- Fluent LINQ - Select a list of parents that contains a list of children where a subset of children are present
- Linq query and multiple where clauses with OR only first condition gets evaluated
- How to put where condition in select condition in Linq query
- vb.net iif condition in linq query where clause
- LINQ Query-Select records where all the children meet a condition
- Add WHERE clause to every LINQ Select query
- Linq to SQL execute where clause only if external condition exists (if variable = x)
- LINQ query returns null reference only after adding where clause
- LINQ query to return MAX date, where all days of that week meet a certain criteria
- LINQ query to conditionally filter on a where clause and select the values from another table
- linq to entities query which has multiple where clause and one where clause with where in condition
- use linq to group by and then run select query with where condition
- Using linq to select an object that has a min Date after a Where condition
- Setting where clause in LINQ query in loop always executes last where clause that was set
- LINQ Select Query with Where Condition Which returns single record
- LINQ Query with dynamic where clause based on search criteria that is NOT part of the returned object
- Linq query update all items in groups that meet my condition
- "OR " condition in where clause of linq query is returning null
- Where clause in complex linq query giving the following error "A query body must end with a select clause or a group clause linq"
- How do I add a where clause to a field that is not part of the return set for LINQ query
- How to query in linq that the field that should be in the where clause is a concatenation of fields
- How to create a Dynamic Query when there's a condition that won't use all fields in the where section with LinQ
- C# Linq query to select top result where a condition is satisfied
- If condition in LINQ Where clause
- Linq - How to select items from a list that contains only items of another list?
- Linq Query with a Where clause in an Include statement
- Why C# LINQ expressions must end with Select or Group By Clause where as no such restriction in VB.Net
More Query from same tag
- LINQ: Dinstinct and merge values
- How to search any items of a list within a string using Linq
- How to get Json data through LINQ in WCF?
- How efficient is IEnumerable.First and IEnumerable.Last?
- Linq to XML decendant elements
- The specified type member 'UserName' is not supported in LINQ to Entities
- SQLite-net TableQuery<T>.Select() poor performance
- Can't find ExpressionVisitor.VisistMemberAcess
- How to get Select Many from relation navigation key using LINQ/Lambda?
- How to get pair value from CultureTypes object in C#?
- No overload for method 'select' takes 2 arguments
- LINQ grouping with aggregate
- How to find(query) through a complex array for checking in IMongoCollection and LINQ?
- Merging Two IQueryable results returning error
- Select values from two tables using “WHERE NOT IN” and DISTINCT in LINQ in Linq to Sql
- linq and string.compare/string.equals in wcf?
- IOrderedEnumerable and defensive programming
- How to frame Linq Query for this condition
- Using LINQ to query XML file
- LinQ to SQL throws Stackoverflow exception when using Any()
- Use SelectMany and GroupBy
- How to update column data using sql query in linq?
- LINQ join to collection using index
- How do I update an entity in EF across multiple ASP.NET requests without retrieving it again?
- How can you determine the current items position whilst looping through the collection?
- Formatting a column of List in C#
- Using LINQ to loop through inner class properties in outer class collection and group by outer class properties
- Checking if list item is empty with LINQ at where condition?
- An item in IEnumerable does not equal an item in List
- Can I do a "Take(x)" on the "Include" entity in a Linq Query?