When I right-click in a .EDMX file and click Generate Database From Model, the resulting script is obviously wrong because of the table names. What it generates is the following script. Note the table names in the DROP TABLE part versus the CREATE TABLE part.
Why is this inconsistent?
This is obviously not a reusable script. What I cre...
Hi guys I have to model the following situation. I came up with 2 possible alternatives, but I want to know if there's a better solution.
Here's the deal...
Simplified Schema
User Group
----------- ------------
UserId (PK) GroupId (PK)
Name Name
... ...
\ /
...
The relative simplicity of Linq-To-Sql as well as all the criticism leveled at version 1 of Entity Framework (especially, the vote of no confidence) convinced me to go with Linq-To-Sql "for the time being". Now that EF 4.0 is out, I wonder if it's time to start migrating over to it.
Questions:
What are the pros and cons of EF 4.0 rela...
How to generate only objectLayer by edmgen tool, without generating csdl, ssdl and views ?
"%windir%\Microsoft.NET\Framework\v4.0.30319\edmgen.exe"
/mode:fullgeneration /c:"Data
Source=.\sqlexpress; Initial
Catalog=uqs; Integrated Security=SSPI"
/project:generateEntityModel
/entitycontainer:uqsEntities
/namespace:uqsModel...
When I use TryGetObjectByKey on my ObjectContext, it returns an error. An item with a duplicate value already exists.
When I look at my objectContext, I see that the ObjectSets are empty. What Am I doing wrong... When I enumerate the ObjectSet by hand, by using ToArray on it, or by using the debugger, it does work.
LazyLoadingEnabled =...
I want to be able to tell if there is any unsaved data in an entity framework context. I have figured out how to use the ObjectStateManager to check the states of existing entities, but there are two issues I have with this.
I would prefer a single function to call to see if any entities are unsaved instead of looping though all entiti...
Through various questions I have asked here and other forums, I have come to the conclusion that I have no idea what I'm doing when it comes to the generated entity context objects in Entity Framework.
As background, I have a ton of experience using LLBLGen Pro, and Entity Framework is about three weeks old to me.
Lets say I have a con...
My table structure is as follows:
Person 1-M PesonAddress
Person 1-M PesonPhone
Person 1-M PesonEmail
Person 1-M Contract
Contract M-M Program
Contract M-1 Organization
At the end of this query I need a populated object graph where each person has their:
PesonAddress's
PesonPhone's
PesonEmail's
PesonPhone's
Contract's - and this h...
We're using POCOs and have 2 entities: Item and ItemContact. There are 1 or more contacts per item.
Item has as a primary key:
ItemID
LanguageCode
ItemContact has:
ItemID
ContactID
We cant add an association with a referrential constraint as they have differing keys. There isnt a strict primary / foreign key as languageCode isnt in...
Hi,
Does Entity Framework v4 support batch updates/inserts so rather than sending >1 command to a db, it can send >1 command to the DB in one go?
Thanks
...
Currently I've been working with Entity Framework 1.0 which is located under a service façade.
Below is one of the save methods I've created to either update or insert the device in question.
This currently works but, I can't help feel that its a bit of a hack having to set the referenced properties to null then re-attach them just t...
Hi Everyone
Is it possible to create the database from the classes with entity framework 4.0? I found many tutorials on how to do it the other way round. But since we have already implemented and tested all classes of the domain we'd like to avoid changing them to much.
If I used the wrong keywords in Google I'd appreciate you could pos...
Can someone please tell me how to get the DB2 provider to show up in the "Change Data Source" dialog window?
Steps:
Right-click on the edmx design surface.
Select "Update Model from Database"
On the Update Wizard, click "New Connection"
Next to the "Data source" textbox, click "Change..."
In the Change Data Source window, I am only ...
Hello all,
I was wondering if EF4 support cross-databse relationships? For instance:
db1
Author
Id
Name
db2
Posts
Id
Content
db1.Author.Id
What ideally I need to do to get this relation in my ef4 model?
Do you guys have any idea?
Thanks
...
I am getting some unexpected behaviour with entity framework 4.0 and I am hoping someone can help me understand this. I am using the northwind database for the purposes of this question. I am also using the default code generator (not poco or self tracking). I am expecting that anytime I query the context for the framework to only mak...
Hi
Is Entity Framework worth moving to for a new small app? About 10 tables and a WinForms app.
ie the alternative being DataTables/DataRows or Linq-to-SQL
...
Right... calling all Entity Framework experts...
I have a table called Bob in my database, my EF model contains an exact mapping/definition of this. I also have a table called Jim who is also mapped to my entity model. Bob can have multiple Jim's and this relationship is enforced by foreign key constraints as it should be. So the relati...
Let's say I have a SQL 2005 database with a table called Restaurants. The Restaurants table has the following columns:
RestaurantId
Name
Latitude
Longitude
I want to let users search for restaurants by name and/or address. How do I write the LINQ query to support this? I need to be able to support the possibility that the user doesn'...
Which is the better choice out of dotConnect or "sqlite.phxsoftware.com" for using Entity Framework with SQLite (in C#)?
...
I am using self tracking entities and have moved the entity classes to another assembly by using 'Add as link' to point to the TT file as mentioned here. Now though, when I update the model (for instance change a property name) the template is not automatically run and so the entity class does not get updated.
I can of course manually ...