score:0
public class SKillIDDemo
{
public int ID { get; set; }
public string Name { get; set; }
public string SkillSetID { get; set; }
}
class Program
{
static void Main(string[] args)
{
List<SKillIDDemo> demos = new List<SKillIDDemo>();
demos.Add(new SKillIDDemo() { ID = 1, Name = "demo1", SkillSetID = "10,1" });
demos.Add(new SKillIDDemo() { ID = 2, Name = "demo2", SkillSetID = "10" });
demos.Add(new SKillIDDemo() { ID = 3, Name = "demo3", SkillSetID = "1" });
demos.Add(new SKillIDDemo() { ID = 4, Name = "demo4", SkillSetID = "12" });
string[] skillset = { "10","1" };
var testme = demos.Where(x=> skillset.Any(a=> x.SkillSetID.Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries).Contains(a))).ToList();
testme.ForEach(g=> Console.WriteLine(g.Name));
Console.ReadLine();
}
}
score:2
1 Dimen1 10,11
2 Dimen2 11
3 Dimen3 10
Source: stackoverflow.com
Related Query
- Linq to sql code for contains
- Scalable Contains method for LINQ against a SQL backend
- Expression to get LINQ with Contains to EF for SQL IN() where on entities child's property equals value
- C# Linq to SQL is contains safe for sql injections
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- linq lambda expression for sql contains
- Equivalent C# LINQ code for SQL
- Check Nullable for object insde LinQ to Sql code
- linq query showing long doesnot contains definition for Contains while converting sql query to linq
- Instantiate empty IQueryable for use with Linq to sql
- How are people unit testing code that uses Linq to SQL
- Best way for retrieving single record results in LINQ to SQL
- What is the easiest way to find the LINQ statement for a SQL statement
- LINQ To SQL exception: Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains operator
- Steps for a beginner to run very basic linq to sql query using Linqpad
- Create Reusable Linq To SQL For Stored Procedures
- How do you do a SQL style 'IN' statement in LINQ to Entities (Entity Framework) if Contains isn't supported?
- LINQ Expression for Contains
- LINQ to SQL visualizer for VS 2010?
- FirstorDefault() causes lazy loading or eager loading for linq to sql
- Use contains in LINQ to SQL join
- LINQ to SQL - How to efficiently do either an AND or an OR search for multiple criteria
- Use delegate for Projection in Linq to SQL
- NHibernate uses wrong column type for LINQ contains query (varchar to nvarchar)
- Linq Contains method for a object
- Dynamic linq query expression tree for sql IN clause using Entity framework
- LINQ to SQL for Oracle.ODP
- Suggestions for designing complex LINQ code
- Linq to entities - SQL Query - Where list contains object with 2 properties (or more)
- linq equivalent of 'select *' sql for generic function?
More Query from same tag
- How to get list from nested list with highest length?
- C# Linq Grouping in one query by different conditions
- What are the benefits of a Deferred Execution in LINQ?
- Using LINQ in ICollection (EF)
- compare nested json collections using C# LINQ
- How to join two tables in linq and not get anonymous type result set
- Mongo C#: Is array field contains element from a given array
- Is it possible to use Entity Framework without LINQ?
- How to select records of user's history of items, where the date is latest for the items in LINQ to entities lambda?
- LINQ Optimization for searching a if an object exist in a list within a list
- Joining two lists with nested lists
- Aggregate function over an aggregate result set using linq
- Getting numeric precision in case of int datatype of SQL Server
- Converting Linq expression to sql server query
- linq sum how to display as currency
- Assigning values in group of Labels by using LINQ
- How to fix the following code so that it is ordered?
- type arguments for method cannot be inferred from the usage returning expression from expression
- Find items that are similar amongst them in List in C# with nested For loops and Linq
- C# Linq, object definition does not contains a property
- How can I get 10 entries from a database, ordered by score, given a starting position, using Entity Framework?
- specify identity value in linq-to-sql
- SelectMany on tuples of { key, values } - obtain key in result?
- Parameter of OfType<????> when used in a method with C#
- group by query with not in sub query linq
- LINQ: Multiple LIKE clauses in a single predicate
- Linq to SQL using Lambda expressions together with Join, GroupBy, Count and Sum
- LINQ null date comparison in Dataset
- Reading Text file with Linq with 2 patterns
- Paging in the stored procedure