score:0
Accepted answer
ienumerable<int> ids = offices.select(x => x.id);
iqueryable<appointment1> appointment = _context.appointments1.include(x => x.patient)
.where(x => ids.contains(office.id))
.asqueryable().orderby(x => x.id);
Source: stackoverflow.com
Related Query
- How do you construct a LINQ to Entities query to load child objects directly, instead of calling a Reference property or Load()
- how do I write LINQ query to retrieve distinct records based on only specific properties?
- How to construct IQueryable query using Linq when I just need count without reading all documents in Document-Db database?
- How do I create a linq query that gets everything but a specific value
- Linq - How to query specific columns and return a lists
- How do you write a LINQ query that filters a sub table to a specific time period and sums the results of the sub table?
- linq how to query a specific date's data
- Linq - How to construct this query without the 'join' keyword?
- How to pick a specific object from a Linq Query using Distinct?
- How to use LINQ to query for specific object in an array in a list of objects?
- How to write LINQ query for fetching the specific records and generating new result at the same time?
- how to return the query result as a specific object type in LINQ
- How get a specific value from a query in Linq
- How to write a LINQ query that will return list of entities whose ID is included in specific list?
- How to construct dynamic LINQ query string be for a query that looks like *abc*def*
- How to dynamically instantiate a more specific type in a linq query
- How to construct a specific linq query?
- How to filterout specific fields from a linq query
- How to construct a LINQ Query to test a list against another list where elements start with the elements from the other
- How do I drill down to specific data in my LINQ query result?
- how to find a string which is exist or not in some specific datacolumns of the datatable using LINQ query in C#?
- How do I construct a LINQ (EF) query to project pages of data
- How to Select Min and Max date values in Linq Query
- How to write a LINQ query resulting in a Dictionary?
- How to avoid Query Plan re-compilation when using IEnumerable.Contains in Entity Framework LINQ queries?
- How to perform LINQ query over Enum?
- How To Project a Line Number Into Linq Query Results
- How do you use LINQ to find the duplicate of a specific property?
- How does deferred LINQ query execution actually work?
- How to OrderBy an integer in a string field in a Linq query
More Query from same tag
- Remove text after a string occurrence
- Linq EF - How to gather all the accounts, cards, loans etc of a specific customer from database, with an optimized query?
- C# list -Eliminate Duplicate items by comparing specific properties
- Object issue in LINQ Query
- rewrite Linq 'to other format'
- adding records to xsd file using linq and C#
- Get Method is null off IQueryable (Entity Framework)
- LINQ Order By to select lowest Index
- Mongodb AsQueryable()
- How do I convert this subquery to Linq?
- Distinct Select ListItem from IEnumerable
- Linq Group by Complex Object (E.G list element of object)
- Method result in groupby
- Access to LINQ results - what is a better way?
- Linq lambda expression many to many table select
- Discrepancies between “Mock” Database and “Real” database behaviours
- Pass a property of a Linq entity in a method to set and get result
- Combining 3 list into 1 LINQ Query C#
- Getting a property value using a LINQ expression
- c# remove elements on a list by comparing with other lists
- sorting when name includes letters and numeric digits
- Joining two tables in linq method syntax, MVC EntityFramework
- LINQ to XML gets no data with schema set
- what's wrong in this LINQ query
- Read Anonymous Type from DataItem
- SQL to LINQ Involving Multiple GroupJoin
- .Net - Custom Paging with random sort
- What is wrong in the below program to generation of permuation?
- Order by one element and return multi properties in the same LINQ query
- filtering a DataTable using LINQ