Questions tagged [entity-sql]

Entity SQL is a storage-independent query language that is similar to SQL.

Entity SQL is a storage-independent query language that is similar to SQL. Entity SQL allows you to query entity data, either as objects or in a tabular form.

98 questions
0
votes
2 answers

Entity SQL query with hierarchal relation

I want to use Entity SQL to query the elements of some subtype in my Entity Model. For instance... SELECT VALUE c FROM Persons AS c WHERE c is of (Customer) no problem meanwhile, but if I try the following query where Active is a property of…
Lester
  • 513
  • 5
  • 15
0
votes
1 answer

Entity SQL Anonymous type?

I have a database with 2 tables : Personal : ID (PK), Name, Code (FK), Birthdate Social : Code (PK), Address When I add a ADO.NET Entity Data Model name Model to my project. The Model.Context.tt has only Personals and Socials Dbset<>, so i can…
0
votes
1 answer

Entity Framework 6: .Where and .Select that accept string parameters?

In “Programming Entity Framework”, 2nd edition by Julia Lerman, in chapter dedicated to Entity SQL, p. 115, we have the following example of using query builder method to do projection using EF 4.1 .Where and .Select with string…
0
votes
1 answer

Comparing DateTime in Entity Framework with an Sql Server Compact database

Why this code throws a System.NotSupportedException telling that The specified method 'int? DateDiff(string, DateTime?, DateTime?)' on the type 'System.Data.Objects.SqlClient.SqlFunctions' cannot be translated into a LINQ to Entities store…
Parsa
  • 997
  • 1
  • 15
  • 38
0
votes
1 answer

How to change the condition of 2 ESQL where clauses in the final expression?

I have a fairly complex query where I am filtering results with a LIKE statement. Here is the query: var qsFilter = entities.QueryStatements.Where("it.Statement LIKE @searchTerm", new ObjectParameter("searchTerm", searchTerm)); var qtFilter =…
esac
  • 24,099
  • 38
  • 122
  • 179
0
votes
0 answers

Added 3 tables in Entity framework

I added 3 tables to my EF: 2 tables for data and the third for connection between them (= 3 columns in this table, first ID as the primary key, and the second and the third are FK to the other two tables). But the problem is that the third table was…
talia
  • 1
  • 2
0
votes
1 answer

Can't resolve a Table Valued Function in EF6.1 Entity SQL

I've been spinning my wheels on this for the last couple days and can't pin down what I'm doing wrong. I'm trying to setup a TVF that I can call in esql. I started using this as my guide, updating the details to 6.1.1 as needed. All my efforts…
0
votes
1 answer

How should I use navigation properties while writing a query using eSQL?

I am trying to write a query using eSQL wherein my entity has got navigation properties. I am not able to include these navigation properties in the query, even though in Linq to SQL we have this (Include method). How will it be possible in eSQL?
bbbbb
  • 29
  • 2
  • 5
0
votes
1 answer

Entity Sql Group By problem, please help

help me please with this simple E-sql query: var qStr = "SELECT SqlServer.Month(o.DatePaid) as month, SqlServer.Sum(o.PaidMoney) as PaidMoney FROM XACCModel.OrdersIncomes as o group by SqlServer.Month(o.DatePaid)"; Here's what I have. I have…
Zviadi
  • 731
  • 2
  • 8
  • 19
0
votes
1 answer

Subquery using ANYELEMENT with Entity SQL

According to the Microsoft Documents (http://msdn.microsoft.com/en-us/library/bb738573.aspx) for Entity SQL in order to return a scalar subquery I need to use the function ANYELEMENT(). However, when I try that I am getting this as my returned…
Erin
  • 65
  • 1
  • 7
0
votes
1 answer

EntitySql CreateQuery Return Type

I'm very familiar with returning a Entity from my model using CreateQuery but how do I return results from multiple tables? I have gotten close by using CreateQuery but this seems to return a…
CkH
  • 1,285
  • 11
  • 15
0
votes
1 answer

Entity Framework / ESQL Query Remove Leading Zeros?

I am trying to construct an ESQL query which should return an address entity after successfully matching its single address field by postcode and house number provided. The house number is always at the start of the string but is sometimes prefixed…
Mike
  • 369
  • 1
  • 6
  • 24
0
votes
1 answer

using datediff in entityframework entity-sql

I want to do something like this using EntityFramework entity-sql query. I am using .Net3.5 StringBuilder query = new StringBuilder(@" Select VALUE o From ordercontainer.report as o WHERE o.xId = @xId …
krishnakumar
  • 617
  • 1
  • 6
  • 22
0
votes
1 answer

c#. EF entity sql. How to get entity with related objects?

I have made simple model for example. public class Publisher { public int Id { get; set; } public string Title { get; set; } public Address Location { get; set; } public virtual ICollection Books { get; set; } } public…
shoma13
  • 317
  • 3
  • 4
0
votes
1 answer

Define a sub-query in a Model-Defined Function in Entity Framework

Is is possible to define a subquery in a Model-Defined Function in Entity Framework? We have a situation where we have a customer object that has a history of names in an another table. We want to return the most current name as part of that…
Rick Arthur
  • 2,410
  • 21
  • 15