score:1
Accepted answer
var _servicetypes = viewmodel.selectedservicetypes;
// _servicetypes is an array of integers
var resultstemp = repository.files.where(f => !_servicetypes.except(f.services.select(s => s.servicetypeid)).any());
score:0
var resultstemp = repository.files
.where(f => f.services.select(s => s.servicetypeid)
.intersect(_servicetypes)
.orderby(x => x)
.sequenceequal(_servicetypes.orderby(x => x));
Source: stackoverflow.com
Related Query
- How to Check Whether an Array (or List) Contains Another an Array (List) Using LINQ
- check whether a List<string> contains an element in another List<string> using LINQ
- How to check if a char array contains every element in another char array?
- check a string array from a list contains a string from another list or vice versa
- How do I check if a member of an array matches any member of another array using Linq?
- how to check that a list contains another list C#
- C# / Unity / Linq - How to check if a list of lists contains a specific another list?
- How can I flatten out a list that contains another list using LINQ?
- How to check if a list contains item in dynamic list using linq
- How to check if one list contains all elements of another list in linq to sql statement
- check if a list contains all the element in an array using linq
- Check whether an array is a subset of another
- How to check list A contains any value from list B?
- How to filter a list based on another list using Linq?
- How to use Linq to check if a list of strings contains any string in a list
- In C#, how can I filter a list using a StartsWith() condition of another list?
- Linq - How to select items from a list that contains only items of another list?
- Check if one list contains any elements from another
- Check if a list contains all of another lists items when comparing on one property
- How to check if all of the elements in a list return true for a property using Linq?
- check whether the list contains item greater than a value in C#
- Check if one list contains all items from another list in order
- How to convert list of objects with two fields to array with one of them using LINQ
- How to check if XML contains element when using LINQ to XML?
- How to remove a List string element if it contains a string element from another List?
- How to generate a unique list of items from another list using LINQ in C#
- How to fill a property of an object from another list using LINQ
- LINQ in C#. Check if one list contains elements from another one
- Check if a value from one array exists in another array using linq
- Using LINQ to get a list of items where the item contains a part of an item from another list
More Query from same tag
- LINQ: why this query works in query syntax but not in method syntax?
- Entity Framework Query Timeout
- Select last value in a month for all given IDs using LINQ
- LINQ - Select all in parent-child hierarchy
- How to alias a column name in LINQ at runtime?
- C# Linq .Contains() .Any() .All() with an array of ids on an array of ids
- C# Splitting a List<string> Value
- How do I Count the number of parent groups using LINQ and child repo
- how do I write this query in linq ( c# )?
- Calculate how much positions of 2 arrays contain equal elements
- group by issue with extra columns
- Select only few columns from a table to map with Odata Select query on C# Web API
- linq sql where closest to number
- select two properties in an array of obj
- Using Ardalis.Specification to query CosmosDb using Linq syntax
- Combination Generator in Linq
- Expression.DebugInfo How Do I Tag Expressions?
- LINQ to SQL - order by, group by and order by each group with skip and take
- Error when Copying Query from linq to Datatable
- LINQ building array with multiple values per select
- Can't add calculated value to IQueryable
- LINQ expressions?
- Need help querying through 3 classes
- LINQ: Converting grouped list into new list
- Get different rows in two typed DataTables with different schema
- Need help on developing LINQ Lambda expresssion to filter on a Schedule
- Using String.Join for multiple items in a List
- retrieving data by LINQ c#
- how to group by over anonymous type with vb.net linq to object
- Calling ToList() on ConcurrentDictionary<TKey, TValue> while adding items