Questions tagged [objectquery]

59 questions
0
votes
1 answer

Server-side execution of Entity Framework Query combined with Stored Procedure

Is it possible to call a StoredProcedure from an ObjectQuery? Basically I want to dynamically build a query and execute it server-side. You can imagine each query to be part of a search where you can combine different criteria with "and" or "or". It…
0
votes
2 answers

ObjectQuery to return object where a child object contains a set value

I have two classes, as follows: public class Route { public ObservableCollection Flights = new ObservableCollection(); } public class Flight { string airlineName; } I wish to return a list of all routes that have a flight…
Gavin Coates
  • 1,366
  • 1
  • 20
  • 44
0
votes
1 answer

ObjectQuery error when using STE and WCF

I received this error when i implement STE in EF4 and WCF "Object mapping could not be found for Type with identity 'NorthwindModel.Customer'." if I'm not using STE (in single project), this code is working. Walkthrough: Serialize Self-Tracking…
0
votes
2 answers

Flattening an Entity Framework objectquery result with includes

I'm trying to get to grips with Entity Framework and there is one thing that's really tripping me up. It doesn't help that I'm still not totally sure of the terminology, and I'm trying to avoid learning LINQ at the same time, so googling is…
tomfumb
  • 3,669
  • 3
  • 34
  • 50
0
votes
1 answer

ObjectQuery as a parameter in ESQL

Assume I have 2 entities: Ent and SubEnt with N:1 relationship. So, there are navigation properties SubEnt.Ents and Ent.SubEnt. Also, I have some ObjectQuery defined: ObjectQuery se; How can I create ESQL query that selects all entities…
Sergey40a
  • 3
  • 2
0
votes
1 answer

problame filtering ObjectQuery.Include method fo permission business logic

I created middleware layer between the BL and the Entity Framework DAL for filtering the data by the user permission business logic in the application. My layer implements IObjectSet that have an instance of the "None filtered ObjectSet" and the…
0
votes
2 answers

How to Find WLAN card in Windows 7

The below code works fine in Win XP til determine the WLAN Card, but in Windows 7 the wmiObjects count is zero. Does anyone have any knowledge to get it working in Windows 7? //Use MSDis802_11_Configuration to determine if this nic is in the list…
Millerbean
  • 295
  • 2
  • 8
  • 17
0
votes
1 answer

Query Object's elements in c#

I have a problem when i try to retrieve query results from object in c#. I did a linq query that return object element and the i wanna get all elements value in c# (server side)... I can't do this and i don't know why! I tried: forech(var x in…
Enricosoft
  • 869
  • 2
  • 10
  • 28
0
votes
0 answers

Which model shall be used by using() in django when there are two models with same name and different apps in the same db?

I have defined a model MyUser in two apps(let's say A and B) in different projects in django with the same DB(CAP_db). The second project uses more than one DB. So, when querying the model MyUser in one of its apps, I am using the statement :…
0
votes
1 answer

Object Query pattern using EF 4 and repository pattern

A question regarding the repository pattern and query object pattern. I'm using EF 4 and have generated my POCO classes from my database model using the ADO.NET POCO Entity Generator in VS 2010. The edmx file and the tt file (POCO classes) are in 2…
OKB
  • 715
  • 3
  • 14
  • 30
0
votes
1 answer

ObjectQuery lambda expression for select inside select

i want to create query like this using lambda expression in ObjectQuery SELECT * FROM tableA WHERE ID in (SELECT ID in tableB) I try using var histories = _entities.ProductViewHistories.Take(5).OrderByDescending(p=>p.DateViewed); var products =…
Adi Widodo
  • 93
  • 5
0
votes
1 answer

ObjectQuery does not work in Entity Framework! Any suggestion what to use insted of

I have struggled with ObjectQuery, but then I found out that it is only used in earlier versions of Visual Studio. I don't know what to use and how to use it in Visual Studio 2017. Can somebody help!? As you can see I'm using Entity Framework. I…
0
votes
1 answer

ObjectQuery invalid argument

i am having a hard time filtering data from a db_Entities model. I have a table bound to a comboBox1 and i am trying to filter data using the commitChanged event within the comboBox1 control. i am getting 2 errors. 1 is :The best overloaded method…
Soundview
  • 43
  • 7
0
votes
1 answer

How to execute an ObjectQuery

Linq to Entities uses the ObjectQuery which implements IQueryable. I normally use the IQueryable methods to filter through my data but today I needed to create a special LIKE statement. The framework keeps thinking its smart and "escaping" my…
TugboatCaptain
  • 4,150
  • 3
  • 47
  • 79
0
votes
2 answers

Can ObjectQuery.OrderBy() use NEWID()?

I found that Entity SQL support NEWID(), but does ObjectQuery support it as well? http://msdn.microsoft.com/en-us/library/bb738616.aspx, Can I write objectquery like: context.member.orderby("NEWID()").select("it.UserID"); or something like this?…
Jeff Chen
  • 736
  • 1
  • 8
  • 20