score:1
Accepted answer
usually, the approach for filtering data like this is with cumulative query composition; for example:
iqueryable<psearchmodel> query =
from kb in db.kimlik_bilgileri
join dbilgi in db.dil_bilgisi on kb.id equals dbilgi.kimlikid
join okbil in db.okul_bilgileri on kb.id equals okbil.kimlikid
join kurbil in db.kurum_bilgileri on kb.id equals kurbil.kimlikid
join ens in db.enstitu on kurbil.kurum_id equals ens.id
join kadr in db.kadro_unvan on kurbil.kadro_id equals kadr.id
where kb.aktifmi == true
select new psearchmodel
{
dilbilgisi = dbilgi,
// diller = dil,
okulbilgileri = okbil,
kadrounvan = kadr,
enstitu = ens,
kimlikbilgileri = kb,
kurumbilgileri = kurbil
};
if (!yabancidil.isnullorwhitespace())
{
int dil_di = convert.toint32(yabancidil);
query = query.where(o => o.dilbilgisi.dil_id == dil_di);
}
// ... add other filters here
var list = query.tolist();
this defers all execution to the end, and allows you to inspect dil_di
when debugging, to see if it is what you expect. if you still don't get what you expect, then you'll have to investigate what sql is being issued, to see why your results are different from your expectations.
score:1
you could search in your list with linq as well. one possibility is this:
yourlistobject.where(c=>c.test.equals("hallo"))
also possible to order or group by equivalent to this.
Source: stackoverflow.com
Related Query
- LINQ query filters not returning correct number of results
- Linq to SQL to return multiple counts from query not returning correct results
- Linq query with a Join, not returning the correct results
- LINQ to SQL query not returning correct DateTime
- linq query for varchar field not returning any results
- DateTime comparison in LINQ not returning correct results
- Why is this LINQ query not returning the correct dates?
- Linq Query With Multiple Joins Not Giving Correct Results
- Why is sql server query returning results and linq query is not
- LINQ query not returning the correct result
- LINQ query not returning expected results
- LINQ query not returning results that I expect
- LINQ query is not returning expected results
- Linq query not returning expected results even when using DefaultIfEmpty
- LINQ Query not returning results
- How To Project a Line Number Into Linq Query Results
- Linq Query not returning IEnumerable
- linq - how do you do a query for items in one query source that are not in another one?
- LINQ Join not returning results if second or third table empty
- How to dynamic add filters to a LINQ query against an Odata Source in C#
- LINQ query returns old results when source list is re-initialized
- Linq Distinct not bringing back the correct results
- C# Linq .Select(int.parse) on empty array results in "Input string was not in a correct format"
- Linq query NOT returning null when empty
- Returning List<string> from Linq query returns query syntax not values
- Linq Query returning IQueryable<IEnumerable<User>> not IQueryable<User>
- 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?
- MS Graph - LINQ query returning incorrect results
- Returning results of LINQ query
- LINQ query results not filtered when mocking IOrganizationService (Dynamics CRM)
More Query from same tag
- Sort results by relevance using linq
- Using LINQ to find a specific value in a List
- LINQ query to create a collection of objects combined from a collection of strings
- How to use if condition inside Linq
- GroupBy method syntax for subquery
- C#: Func<> instead of methods?
- How do I negotiate joins and groupings based on nested properties in LINQ?
- Linq to Entities filter navigation collection properties
- Reproduce a "DELETE NOT IN" SQL Statement via LINQ/Subsonic
- Using an extension method on a base class in a LINQ query
- How can I Pass in a lambda that will be used as a filter for a row in a datatable?
- How do I convert a recursive object to a Collection in C#?
- Error when replacing .ToList() calls in with an IQueryable
- Db4o query: find all objects with ID = {anything in array}
- LINQ Multiple Nested Table Aggregate Query
- "Cannot Resolve Symbol Select" Trying to use LINQ with DataRowCollection
- How to write this functionality as a generic extension method in C#?
- Passing a value, retrieved from a linq statement in a view, to its controller
- EnumHelper.Parse in LINQ JOIN Query
- Make dynamically HangFire connection string .NetCore
- How to use LINQ select something contain string[]
- LINQ select new Async/Await
- checking for null in lambda expression - linq
- mvc fill dropdownlist
- Get records from datatable grouped by date and every two hour
- C# List.Contains does return true when it should
- Linq select Distinct by two properties
- How to order the item categories in linq
- Problem with Linq Joins with multible keys?
- Iterate and select over two dimensional string array with LINQ