Questions tagged [ef-model-first]
231 questions
1
vote
0 answers
Error after changing column name
I'm using Entity Framework model-first. Recently I've changed in my table Clip a column name from PropertyName to Name. Clip has a foreign key with the id of table Main. I want to add a new record to table Main, but I'm receiving a weird…

Paweł Reszka
- 1,557
- 4
- 20
- 41
1
vote
1 answer
Entity Framework - Manually Add Properties to Many-to-Many Relationship - Model First
Scenario:
As mentioned here, once you add additional properties to a simple join table (many-to-many relationship), it's no longer a hidden association. These questions also address this:
Many-to-Many relationship in Entity Framework with…

drzaus
- 24,171
- 16
- 142
- 201
1
vote
3 answers
MV4 Application with EF5 model first, without ViewModels or Repositories
I'm building a MVC4 app, I've used EF5 model first, and kept it pretty simple. This isn't going to a huge application, there will only ever be 4 or 5 people on it at once and all users will be authenticated before being able to access any part of…

user1956434
- 23
- 3
1
vote
1 answer
mysql.data conflict something in my entity framework project
I'm using MySQL database in my Ado.Net project. So I am using entity framework model first. It is good but when i want to add "mysql.data" (which i get from mysql web site named mysql data connector) to the Referances, it gives me an error like…
user1372430
1
vote
1 answer
1:1 relationship problems with EF Model First
I'm trying to develop an application as Model-First with EF. I tried everything to accomplish a table-splitting pattern and a 1:1 relationship but looks like EF just doesn't let me.
Assuming I do use Model-First - is there a way to put a 1:1…

user1695928
- 41
- 6
1
vote
1 answer
How to set a field as indexed in Entity Framework Model-First designer
This has been asked a lot in the past, and I know that there was no direct support for setting a field as indexed in the EDMX designer, but since Visual Studio 2012 is out and Entity Framework 5 is released, it may now be supporting editing indexing…

Can Poyrazoğlu
- 33,241
- 48
- 191
- 389
1
vote
1 answer
Change the state of a relation in Entity Framework
My question is directly in relation to this one.
The accepted answer says "You also have to change state of the relation".
I use Model-First approach, and I don't have the foreign key in my entity. I only have the navigation property.
I Can change…

Johnny5
- 6,664
- 3
- 45
- 78
1
vote
1 answer
SQL Server computed columns and EF model-first
I'm working with EF5 using the model-first approach. I've designed the model and executed the SQL script which generated the corresponding database (using "Generate Database from Model").
I then had to use UDFs to calculate a couple of column…

ury
- 1,050
- 11
- 22
1
vote
1 answer
Create Database Instance from Model
*Seems like there is some confusion. I created a SQL Server Compact Edition file and can see it from the Server Explorer. I can also right click and add tables manually. What I want to do is run the generated sqlce file to add all of the tables…

Joshua Lowry
- 1,075
- 3
- 11
- 30
1
vote
1 answer
How does Entity Framework detect rows affected by an update statement
I'm using Entity Framework, model first, self-tracking entities with Npgsql provider (VS2010 - .NET 4 target).
I'm trying to track optimistic concurrency exceptions, but my problem is that as soon as a column in the entity is marked as fixed, an…
anon
1
vote
1 answer
Entity Framework (.NET) Round-Trip Modelling with Model First?
I am currently working on a project where I want to use the Entity Framework
for the first time. I read much information in the books of Lerman/Miller,
in MSDN, the ADO.NET blog and here on stackoverflow about the most recent
developments regarding…

juniper
- 311
- 5
- 13
1
vote
1 answer
How can I initialize a database when using EF MF?
I have an application using EF 4.1 (using the model-first flavour), and I want to initialize the database when the model is updated and the database is dropped and re-created.
I've spent hours trying to find decent documentation on this, and I…

Gary McGill
- 26,400
- 25
- 118
- 202
1
vote
1 answer
What is the best approach to create new tables in existing db with data?
I am about to begin a new project which will target an existing database with some existing tables with data. As part of my project, i will create some new tables and make relation ships with the existing tables ? Which approach is better in this…

Happy
- 1,767
- 6
- 22
- 26
1
vote
1 answer
Model first junction table using foreign keys as composite primary key?
I have a Job table and a Contact table, I need to create another table JobContact to allow many to many, but I want the JobId and ContactId to be used as its primary key.
I need it on the designer so I can add additional columns to it.
Is there a…

Shimmy Weitzhandler
- 101,809
- 122
- 424
- 632
1
vote
2 answers
How can I run my Entity Designer DDL Script through C#?
I tried several approaches to run my Model-First Entity Designer SQL file through C#, but with no luck. I have an SQL file with all the code in it which I load and read from.
Below is my code. It gives an error on every single command executed. Note…

Mathias Lykkegaard Lorenzen
- 15,031
- 23
- 100
- 187