Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
-1 votes
1 answer
64 views

LINQ query where clause in list

I am trying to limit the data returned via a repository using the where clause based on a list of values. I have a PurchaseOrders entity where I want to return all purchase orders that have an ...
michael's user avatar
  • 35
0 votes
1 answer
69 views

Why linq contains always returning false value when combined with empty and non empty strings?

Details: In this below code _reportData.DistrictID and reportData.BeneficieryID values are "". But filter condition is not working. My requirement is to get matching values from the table. ...
Sneha's user avatar
  • 468
0 votes
0 answers
196 views

C# & Entity Framework, compile error CS0854

I have this query in Entity Framework to SQL Server: resultadoConsulta = resultadoConsulta .Where(q => (typeViewId == null || listaTypeViewsIds.Contains(q.TypeViewId)) &&...
Juan Castillo's user avatar
0 votes
2 answers
454 views

LINQ - Condition with .Contains() is not working as expected

I cannot seem to get the desirable filtered result from my query. Data public class fdp_1115 { public string Id{ get; set; } public string Number{ get; set; } public string Type{ get; set; ...
whatISboolean's user avatar
0 votes
1 answer
42 views

C# Linq Replace Not Filtering Correctly in Jquery Datatable

The following is supposed to work as so: User enters value "Apartment 101" in the "Apartment/Space/Other" search field. The "Apartment" part of the value is replaced by ...
csharpdev's user avatar
1 vote
2 answers
136 views

LINQ query to find elements from a list in a csv file

I am trying to find if a any element of a first list is found for each line of a csv file First list : XX01235756777 YY01215970799 Second list (that would be the csv file) : Column_1|Column_2|...
Ekel's user avatar
  • 13
-1 votes
3 answers
113 views

How to use Contains method to search within another collection?

I have a list of int. List<int> numberList = new List<int>() { 1, 2, 3, 4, 8, 10, 2}; Now, I have another list of int List<int> numberListEnhanced = new List<int>() { 1, 2, 3, ...
test buddy's user avatar
0 votes
3 answers
643 views

Linq get element from string list and a position of a char in this list

i want to get an element from a list of string and get the position of a char in this list by using linq ? Example : List<string> lines = new List<string> { "TOTO=1", "TATA=...
Newbie_thefirst's user avatar
2 votes
3 answers
2k views

Using LINQ to check if a string contains a list of strings or characters

I've seen this question asked in different ways (check if a list contains a certain string or whether a string contains any given character) but I need something else. The programme I'm working on is ...
GasPanic's user avatar
-2 votes
1 answer
93 views

How to check if any word in my List using .contains() method

I want to get record by using .Contains() var question= ""; var allLanguage = new List<USerLanguage>() { new USerLanguage(){LanguageName="English (United ...
Mr. Das's user avatar
0 votes
5 answers
164 views

How to Find List Item that is Present in a String

I have to find whether the String Contains one of the Exact word which are present in the List. Eg: List<string> KeyWords = new List<string>(){"Test","Re Test","...
Ajay Upadhyaya's user avatar
0 votes
1 answer
1k views

Using LINQ and contains with comma separated values

I am trying to get multiple values from a LINQ query using contains. In Contains condition, I want to pass comma-delimited values like, I wonder if it is possible, here is the code UnitQuery = ...
Mr_roomi's user avatar
0 votes
0 answers
64 views

Linq EF --> Contains condition does not work

I have a problem: I have this table ID Title GenreID Genre Duration 1 Movie1 1,2 Cartoon, Family 80 2 Movie2 3,4 Horror, Drama 76 3 Movie3 4 Drama 110 4 Movie4 1,2 Cartoon, Family 200 I need to ...
Alexgr79's user avatar
0 votes
1 answer
1k views

C# Hashset.Contains with custom EqualityComparer never calls GetHashCode()

I have a very large (hundreds of thousands) hashset of Customer objects in my database. Then I get a newly imported hashset of customer objects and have to check for every new object, if it is ...
ilovestackoverflow's user avatar
0 votes
1 answer
33 views

does not contain a definiton for where for linq

I want to query from Users table with linq query. I am getting an error on this line on "Users.Where"; var KisiList = Users.Where(w => w.Userstatus == 1 && w.Isactive == 1)....
jiyanyasli's user avatar

15 30 50 per page
1
2 3 4 5
14