Questions tagged [ef-model-first]
231 questions
0
votes
1 answer
How can i map an existing foreign key to a navigation property with code first
I'm using code first to create an application of customer management.
A customer can have many addresses but only one "main" address.
Here is my Customer model :
public class Customer
{
[Key]
public int Id { get; set; }
public string…

Sébastien Cambon
- 49
- 3
0
votes
2 answers
One to zero or one relationship using composite key and database first
I'm failing at creating a 1 to 0..1 relationship between two tables, where the primary key is a composite key consisting of two columns.
The tables are imported to the EF with an many to many relationship, changing the relationship to 1 to 0..1 or 1…

Michael Sander
- 2,677
- 23
- 29
0
votes
1 answer
Entity Framework 4 with SQL Server Express files
I know that if you use EF in a model-first manner in VS2010 with a standard SQL Server database then it is easy to apply the generated DDL to the database. Is there an easy way to do this with .mdf files (SQL Server Express Files)
Thanks in advance.

ridecar2
- 1,968
- 16
- 34
0
votes
1 answer
How do I create Entity Framework Model First Association Table?
I need to write a DB script which creates an association table in my database, creating a parent-child structure within a single table. The resulting model should be something like this:
with n to n relation between the articles.

Fenixp
- 645
- 5
- 22
0
votes
2 answers
Entity Framework: Using GUID as primary key
I want to implement the GUID as the primary key in my models. I use a model-first approach, and I want the GUID to be generated not in the database, but in the .NET server.
I've seen a solution that said that I would have to do this for each…

ascherman
- 1,762
- 2
- 20
- 41
0
votes
1 answer
Populate Column Default Value Inside Database Entity Framework Model First
Is there any EF Model-First approach to populate LastModified column to GetDate() function in database.
Most of my searches took me to code-first alternatives. But could find Model-First approach. I see StoreGeneratedPattern = Computed in properties…

Abhijeet
- 13,562
- 26
- 94
- 175
0
votes
0 answers
use items in select query that don't include in Group by
I am using EF6 to develop an application that uses a huge data,so in one of my query
his = db.HISTORies.ToList();
front = db.Fronts.ToList();
warehouses = db.Warehouses.ToList();
//------
var q =
…

Ehsan Akbar
- 6,977
- 19
- 96
- 180
0
votes
1 answer
Steps to deploy a model-first EF app
Now that my EF app (app which accesses MS SQL server 2008 Express using EF 5 Model-first approach) is working on my development machine, I need to deploy (or install) it on a deployment machine.
What are the steps involved in setting up the…

Vikrant
- 253
- 4
- 15
0
votes
2 answers
How can I model table to be shared by other tables with 0 to many relationship?
I want to share Contacts entity between my Customers and Vendors.
Customers can have many Contacts
Vendors can have many Contacts
...but when I made my model I ran into a problem where now I have to supply both CustomerId and VendorId to each…

user3928549
- 5
- 1
- 4
0
votes
1 answer
DTO/POCO with Entity Framework
I'm using EF5 Model First. I don't really understand what are the auto-generated classes from the EDM. According to some documentation this classes are POCOs but why are they used in the context ?
Assuming I have a Student entity, then I get a…

Llm
- 147
- 4
- 9
0
votes
1 answer
EF6 Modelfirst and creating Database views on initialisation
I'm pretty new to Entity Framework, and I might be having a hard time "asking the right question" on google. So i'll try here.
First some facts:
I'm working on a project based on the Entity Framework 6.x.
I'm using the Model First approach.
The…

user705703
- 41
- 6
0
votes
1 answer
How to add custom property to entityType in designer
I am doing model first development.
Need a way to extend Entity Framework so that I can specıify displayName from the designer

tsadigov
- 25
- 6
0
votes
1 answer
Entity Framework model first conflicting table name
I have a database with a table named System. When I import it as a model first approach I have a conflict with System namespace in .NET framework. Is there any way to workaround it?

Alex Honcharuk
- 23
- 1
- 6
0
votes
1 answer
ASP.NET MVC Model First Many To Many
I have some problems working with model first many to many relationship. Since I created many-many relationship between Town and Author via interface builder it created table TownAuthor with keys Towns_TownID and Authors_AuthorID but I want that…

Želja Huber
- 337
- 5
- 14
0
votes
1 answer
Entity Framework Model First DateTime default value
I'm trying to give some DateTime fields default values from the model browser.
Whatever I type into the Default Value field, I get an error telling me The value must be in the form 'yyyy-MM-dd HH:mm:ss.fffZ'. I am assuming that format string uses…

jcarpenter2
- 5,312
- 4
- 22
- 49