Questions tagged [iqueryable]

.NET Framework Interface, providing functionality to evaluate queries against a specific data source wherein the type of the data is not specified.

The IQueryable interface is intended for implementation by query providers. It is only supposed to be implemented by providers that also implement IQueryable(Of T). If the provider does not also implement IQueryable(Of T), the standard query operators cannot be used on the provider's data source.

The IQueryable interface inherits the IEnumerable interface so that if it represents a query, the results of that query can be enumerated. Enumeration causes the expression tree associated with an IQueryable object to be executed. The definition of "executing an expression tree" is specific to a query provider. For example, it may involve translating the expression tree to an appropriate query language for the underlying data source. Queries that do not return enumerable results are executed when the Execute method is called.

http://msdn.microsoft.com/en-us/library/system.linq.iqueryable.aspx

1457 questions
-2
votes
1 answer

IQueryable and ISession

Which way is better to use? ISession session = SessionController.Factory.OpenSession(); IQueryable myObjectdquery; 1. myObjectquery = session.Query(); myObjectquery = myObjectquery.Where(x=>x....) or 2. myObjectquery =…
Josef
  • 2,648
  • 5
  • 37
  • 73
-2
votes
1 answer

Cannot implicitly convert type 'System.Linq.IQueryable' to 'System.Web.Mvc.SelectList'

I have a method in my controller: private void ConfigureViewModel(EngineOIRemovalsViewModel model) { model.MajSecList = db.EngineOIRFRs.Select(m => new SelectListItem { Value = m.MajorSection.ToString(), Text =…
Jeff S.
  • 33
  • 7
-2
votes
1 answer

IQueryable fills null values with other values

Here is what I want to do : Get a List of Batch Objects in my controller that I can send to the view and display it. It's working but the values are mixed up. If the value in the database is null or 0, the query fills it with another non-null value…
Helpha
  • 452
  • 6
  • 17
-2
votes
2 answers

Not Returning properly

I was trying to get employee list which not already available in another list. but im getting only first element from array list. ex : if i try EmployeeId = new int[2] {5, 2}; the list excluding only '5'. So please help me correct my below code.…
Ahmed
  • 21
  • 1
  • 1
  • 5
-2
votes
1 answer

IQueryable with RadioButtonList.SelectedValue

May I use the selected Value from the RadioButtonList in the IQueryable to get selected values from a table? I have RadioButtonList with DataValueField="Code" My code is public IQueryable GetValuesfromTable() { return…
Peter
  • 1
  • 1
-2
votes
3 answers

How to apply Contains( ) on a string array using LINQ to SQL c#

Good Day! string[] keywords = toolStripTextBoxSearch.Text.Split(' '); IQueryable query = db.employees; foreach (string keyword in keywords) { query = query.Where(data => data.empName.Contains(keyword) ||…
Farhan Aslam
  • 81
  • 2
  • 13
-2
votes
4 answers

How IEnumerable Can Store Data

How an Interface like IEnumerable or IQuerable can store data into itself? or for example where this Tables go on `IQueryable? and How can I have an Interface like that for myself ? public Interface IMyNumerator { } IMyNumerator
mohammad jannesary
  • 1,811
  • 1
  • 26
  • 27
-2
votes
2 answers

IQueryable Query Performance Tuning

I would like some suggestions for how to make this simple LINQ code to be as fast and efficient as possible tbl_WatchList contains 51996 rows The below test takes 2 secs to run according to VS2012 test explorer [TestMethod] public void…
JGilmartin
  • 8,683
  • 14
  • 66
  • 85
-2
votes
1 answer

How return empty expression?

I need return empty filter (non filter) if filter.Operator equal 'override'. How to do this? Func, KendoFilterDescription, IQueryable> appendFilter = (filteredData, filter) => { if (filter.Operator == "override") …
Mediator
  • 14,951
  • 35
  • 113
  • 191
-2
votes
2 answers

IQueryable - Why is it better then IEnumerable?

Possible Duplicate: What is the difference between IQueryable and IEnumerable? I read so much about IQueryable and I still dont understand when to use what and what are IQueryableProvider's methods used for. My english isnt perfect so…
Stav Alfi
  • 13,139
  • 23
  • 99
  • 171
-3
votes
1 answer

Problems with converting List to IQueryable in Linq

EDIT Actually this question should be more general: How to modify query to DB if Linq with IQueryable gives errors? The correct answer is as far as I understand — to get as much of the query done at the database level. Because in this particular…
MDspb
  • 35
  • 2
  • 11
-3
votes
1 answer

Predicate where condition is not working in IQueryable but working after converted IQueryable to ToList()

var predicate = PredicateBuilder.New(true); predicate = predicate.Or(i => Convert.ToDateTime(i.Entrydate).ToString("M/d/yyyy").Contains(searchText));` Entrydate is DateTime? type so directly I can't able to use .ToString('M/d/yyyy') string…
-3
votes
1 answer

Can you add a Where() to an IQueryable when the field is not in the selected output

Suppose I have a 2 table join in a function that returns an IQueryable, but the output is a named type that is neither of the two tables: var qry = from p in Persons join h in Hobbies on p.PersonId equals h.PersonId select new…
Randy Magruder
  • 171
  • 3
  • 11
-3
votes
1 answer

"LINQ to Entities does not recognize the method" on IQueryable.Where

This compiles, but at runtime it throws an exception. using (var edmx = new MyEDMX()) { Expression> pred = (sr, idx) => sr.Foo >= searchParams.MinFoo && sr.Foo <= searchParams.MaxFoo ; …
-4
votes
1 answer

how to access the implementation Queryable.Count Method?

how to access the implementation Count(IQueryable) method? That's the assembler code:
lotfi91
  • 1
  • 1
1 2 3
97
98