score:0
Accepted answer
...
if(offices.any())
{
// get all active single steps and the ones that contain the offices
singlesteps = _singlestepservice.where(s => s.statusid == (int)enumerations.stepstatus.active).where(s => offices.contains(s.officeid));
// get all of the parent workflows for the singlesteps
var workflows = singlesteps.select(w => w.workflow);
// update the query with the limited scope
query = query.where(q => q.workflow.contains(q));
}
return query.tolist();
}
Source: stackoverflow.com
Related Query
- Retrieving information from derived child object collections using LINQ
- How to find child element from Json or class object using Linq
- What is the correct way of retrieving a given business object from a list of business objects using LINQ Where vs. Find?
- Retrieving non-duplicates from 2 Collections using LINQ
- Retrieving an XElement from Dictionary object (<string, List<XElement>>) which contains List of XElements using Linq
- How to get first object out from List<Object> using Linq
- Create a list of one object type from a list of another using Linq
- Create Items from 3 collections using Linq
- Using Linq on a Client Object model result from sharepoint
- Select object from nested collection using Linq
- Problem with LINQ to Entities query using Sum on child object property
- Retrieving Data from database within the last 7 days using linq
- How to fill a property of an object from another list using LINQ
- How to use Linq to select and group complex child object from a parents list
- I am trying create a new list of users from a list of users who have not created an additional object with a certain property using LINQ
- get parent name and child count from model using LINQ
- Get minimum and maximum time value from list of object property using Linq
- How to write LINQ query for getting object from another object using C#?
- Getting weird behavior when retrieving data from Microsoft CRM using LINQ
- Dictionary from other dictionary grouping by object value field using linq
- Populating object properties from DataSet using LINQ
- How to get the second repeated item from a collection of objects using LINQ to object
- Using Linq to select into an object with children from Json
- Write SQL queries using LINQ from linq object List
- How do I return a new object from a mocked repository using a LINQ Expression?
- Extracting values from a nested object and sorting them using LINQ
- Get specific value from nested collections using LINQ
- How to pick a specific object from a Linq Query using Distinct?
- Create a list of int using LINQ from cell collections
- Selecting an object using Linq from an ordered result
More Query from same tag
- how to recursive load n children in comment table when lazy loading and proxies is false?
- Does LINQ do short-circuit evaluation in VB.NET?
- ObjectMaterialize in EF not firing on first level query
- Quicksort using LINQ
- How do you generate SQL using LINQ?
- Wrong result in string comparision in linq
- How do you create a dynamic select projection from a generic using Linq in C#?
- Convert list of strings to list of simple objects
- Moq with IQueryable Extension Methods
- Linq query is not populating Child Collection
- Having trouble grabbing values from groupby
- Group by date and select statement
- class member variable and "Queries with local collections are not supported"
- inline If run all part of statements with out condition
- How can I implement NotOfType<T> in LINQ that has a nice calling syntax?
- merge several lists but keep only values that are found on all the list
- LINQ - Group List<T> to Year, Month, Day
- Dynamic Linq OR with int and string
- Sending e-mail notifications upon first update of an item
- Populating a List<class> from a query, results from List is address of the class
- C# Linq groupby method syntax
- Passing list to view using Linq Union results in non-distinct results
- LINQ to extract duplicate data more than 3
- Is it possible to re-group the result of using a LINQ GroupBy()?
- How to use my own methods or write a DbFunction for EF Core querying (EF Core 3.0)
- Unable to cast object while cast two identical object
- What are the EF Rewrite Rules?
- Linq to EF .Clear() does not clear
- How to get values out of XML elements containing a colon
- Should the MongoDb Official driver translate a Distinct() linq operator into a database operation?