This question follows on from a question I asked yesterday about why using the join query on my Entities produced horrendously complicated SQL. It seemed that performing a query like this:
var query = from ev in genesisContext.Events
join pe in genesisContext.People_Event_Link
on ev equals...
I have setup 4 separate tables that have fk relationships between all of them. The main problem I am having is between a table called EmployeeQuestions and Questions tables. I am using Entity to model the objects. When I get my EmployeeQuestions object I check it to make sure that the relationship between the EmployeeQuestions and Emp...
Let's say, I have 2 classes in the model: User (mapped to USERS table) and PrivilegedUser (inherits User, additional info is stored in PRIVILEGEDUSERS table).
Now, I have a row in USERS (and instance of User) and need to convert that user to PrivilegedUser (i.e. to create a record in PRIVILEGEDUSERS with the same Id). Is there a way to ...
I have VS08 SP1 Professional Edition (9.0.30729.1) running with .NET 3.5 SP1 Framework.
I am using this tutorial to build an EF/POCO environment, but I can't find ObjectSet<T>, only ObjectQuery<T>, so I suppose the EF I am using isn't the fourth version.
What do I need to do to have EF 4 running with my VS08?
...
I'm only dealing with one database table / entity object: NodePath.
Given a particular Node, I want to get only a subset of all its NodePaths according to this query:
select
*
from
NodePath
where
NodeId = @GivenNodeId and
Id in
(
--active paths
select
a.Id
from
NodePa...
I would basically like to know things such as:
Advantages/disadvantages between the two?
Similarities/differences between the two frameworks?
How are they similar/different architecturally?
How much boilerplate code is needed to use each?
Can the Entity Framework be used efficiently outside of Visual Studio compared to NHibernate? Is t...
Hi
I am just starting out with the Entity Framework and in my ms sql database I made a diagram in some relationships of tables have a primary key to primary key relation ship what I conceive as 1 to 1 relationship.
Now I generated EF database in VS2008 and these same ones have a relationship of 1 to 0..1
So it seems to say "0" or "1"....
I am learning EF and making some code, and I have this relationship below.
When I try to do:
var users = from u in db.Users
where u.Name.StartsWith("F")
select u;
if(users.Count() > 0)
{
var dto = users.First();
}
The user 'Fabio' is returned, but the area count is 0. He has a relationship with an area...
I was wondering how i compared to an array of ids in EF1.0
I know in EF4.0 Beta 1 there is a contains methods so it would look something like this
int[] associationIds = GetAssociationIds();
from c in Associations where c.AssociationId.Contains(associationIds) select c;
But how do you do the equivalent in EF1.0
...
Hello,
I'm currently using Entity framework, and I want to perform a Linq query with a join on two columns, one being of type 'String', and the other of type 'Int32'.
Somethign similar to
from FirstEntity obj in context.FirstEntity
join SecondEntity obj2 in context.SecondEntity on obj.SecondEntityId equals obj2....
Is there a way to do a left outer join in linq-to-entities WITHOUT having tables mapped with foreign keys?
Also, if our company decides to stick with using linq-to-entities despite all of its current flaws, do you think it's important to get Visual Studio 2010? In other words, what is in Visual Studio 2010 that would help developing wit...
hi ,
i am using ADO.NET Entity framework for connect db and get data.I wanna do if there is no data in object it will write "EMPTY FIELD" if its full than it will write to listview coloumn data from the db.I am getting 'System.NullReferenceException' ERROr. when there is a null object in objectcontext.Dont return a" EMPTY ROW" string.
h...
Hi,
I'm using ADO.NET Entity framework for my project and I am new at this techonology.
There are 2 associated tables, one is "personel" other is "departmant". When I tried to update personel's departmant I am getting this error:
[System.InvalidOperationException] = {"'DEPARTMANID' property is piece of object's key information and can ...
I am having a WPF desktop application that uses SQL CE (compact edition 3.5 ) and using the Entity Framework as a Datalayer.
As It turned out in (http://support.microsoft.com/default.aspx?scid=kb;en-us;958478&sd=rss&spid=2855 ) and (http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/b6bac277-cf66-4c74-a0b3-e48abedbd161/...
Has anyone been able to find a clean solution to display a foreign key value in a GridView using an EntityDataSource?
For example, my Employees table has a (FK)JobTitleID and I want the Employees GridView to display a Job Title column.
...
I have an issue with EntityFramework and "set transaction isolation level read uncommitted"
We have changed EF to call a base class (by not using the edmx , this is possible)
In the base class we have overridden the createQuery method to include a call to a SSDL function
<Function Name="Uncommitted" IsComposable="false">
<CommandTe...
I am using AutoMapper + EF (Entities => POCO) for the following class:
public class Category
{
public int CategoryID { get; set; }
public string Name { get; set; }
public Category Parent { get; set; }
public IList<Category> Children { get; set; }
}
Since this class has relationship with itself (Parent / Children), A...
Is it possible to output the SQL generated by the Entity Framework on a global level and not on a query by query basis? I'm looking to just dump it all somewhere so I can review it.
If that is not possible, how do I view the SQL being generated for updates and inserts?
...
First of all, let me state I'm very new to EF. With that said, here's my dilemma:
There will be an ASP.NET App migrated to ASP.NET MVC. I would like to utilize EF for this. There is one main database which stores "client information". Apart from that, every "client" has their own database. These are the constraints we have.
Currently, ...
Hi
I just got this book
In it there is a .dll for a generic repository. I followed what he did but I always get a error.
System.InvalidOperationException was caught
Message="The EntitySet name 'MyEntities.CarSet' could not be found."
Source="System.Data.Entity"
StackTrace:
at System.Data.Objects.ObjectContext.GetEntitySet...