score:1
Accepted answer
var products = db.product_procedure(username)
.where
(item => (item.basedescription ?? "").contains(searchword)
|| (item.info ?? "").contains(searchword)
|| (item.itemno ?? "").contains(searchword)
|| (item.itemno ?? "").contains(searchword.replace("-", ""))
|| (item.upc ?? "").contains(searchword)).tolist();
Source: stackoverflow.com
Related Query
- Stored Procedure Results Return Null When Where Clause is Added in LINQ
- Linq query where First() appears to return null when results are not found
- When using a LINQ Where clause on a Dictionary, how can I return a dictionary of the same type?
- When Where clause is used inside Linq statement produces different results than when used outside
- Include where clause on linq query when param is not null Npgsql
- Linq Where clause not returning what I expect when performing String.Contains(String) on a null string
- LINQ query does not return any results when using with where condition
- List is null when checking for two conditions in where clause with boolean datatype in Linq
- What does LINQ return when the results are empty
- LINQ: adding where clause only when a value is not null
- linq where clause and count result in null exception
- Stored Procedure return values with linq data context
- linq where clause when id is in an array
- Linq query works with null but not int? in where clause
- Return an empty collection when Linq where returns nothing
- Linq where clause with multiple conditions and null check
- When to use lambda expressions instead of a Where clause in LINQ
- LINQ to SQL: Stored Procedure Results
- Linq stored procedure to return XML
- Linq to SQL: Where clause comparing a Nullable<DateTime> with a SQL datetime null column
- LINQ query null exception when Where returns 0 rows
- Linq to EF guid in where clause always returns null
- Filtering by Where clause only when condition is not null
- Using LINQ when my where clause will contain a LIST
- Why does EF not return any results when comparing null variable?
- Return newly inserted row id from stored procedure using LINQ toSQL
- Conditionally allowing for null in LINQ WHERE clause
- Stored Procedure does not and should not return anything results in error
- why null values not return in when apply != in linq
- How to return null when the Linq query returns empty value?
More Query from same tag
- Linq select subgroup
- C# Linq select and cast without error
- How do I convert this double foreach loop to just lambdas?
- Vb.net pare down a lists of objects
- linq query to create new objects
- LINQ - Merge two queries and exclude items from the first query
- order by culture is not working as expected
- Unable to translate LINQ Query
- Converting nested foreach loops to LINQ
- Select specific records in a c# list with a max value
- LINQ "MaxOrDefault"?
- Check each value of an enum is in at most one element of a list using LINQ?
- Filter Related Tables in LINQ
- How to merge an IEnumerable into a ReactiveList and remove the duplicated items?
- Is it possible to use Enumerable.Sum() extension with dynamic types?
- How to delegate parts of a where clause to a different area
- Does C# 7 allow to deconstruct tuples in linq expressions
- Linq to Entities simple group query
- Is there a way to analyse how a particular Linq-to-objects query will execute?
- Range variable name cannot match the name of a member of the 'Object' class. when querying a DataGridView using Linq
- check for a substring(of a string) in the dictionary and return the key's(substring) value
- opening binary files from SQL using LINQ
- Remote Attribute not allowing Post
- Why Ordered collection enumerates slower and how to handle it?
- LINQ to Entities: queryable extension method not reconized inside where condition
- Why didn't the LINQ designers stick with using the way sql is written today?
- Independent subquery in linq
- Select statement only searches by check boxes when kept in the where statement
- How to parse this xml using linq
- Event delegates disappear after being added in a foreach loop