Questions tagged [ef-model-first]
231 questions
0
votes
1 answer
Automatic redirect to login page after a certain time
I am using form authentication. My code in web.config is:
I've used [Authorize] at the head of the actions, that need authentication to access. As my…

raisul
- 640
- 1
- 5
- 26
0
votes
1 answer
Adjust generated model first code for WPF in Visual Studio
I use the Model Designer of Visual Studio to generate my object classes. Now I want to adjust the generated classes with inheritance and getter/setter changes.
If the Model Designer for example has created the class Browser:
public partial class…

10ff
- 813
- 4
- 16
- 31
0
votes
1 answer
About Multiplicity in Model first: Does Many mean '0..*' or '1..*'?
I'm new to database and Entity Framwork, when I use Model first to build a database, there are three choices, so here Many means 0..* or 1..* ? If a relationship is one to many, here Many is kind of 0..* , does it mean a foreign key here is…

user2686390
- 1
- 1
0
votes
1 answer
How to specify composition in model-first EF?
I have following Domain.
Role is an abstract class. Programmer extends Role. Employee has multiple Roles like Programmer, Manager, etc.
I want to create a Model for it. How can we specify this composition of Roles in Employees entity?
Note:…

LCJ
- 22,196
- 67
- 260
- 418
0
votes
2 answers
Entity Framework Inheritance and Logic
I've been creating a prototype for a modern MUD engine. A MUD is a simple form of simulation and provide a good method in which to test a concept I'm working on. This has led me to a couple of places in my code where things, are a bit unclear, and…

Kody Manharth
- 23
- 3
0
votes
1 answer
Database design with a single entity with many different units
I'm new to database design and I am working on a project that requires the use of a single entity (medication) that could be tied to any number of patients and each patient could have a different dosage. What would be the best way to layout a table…

jbolt
- 688
- 3
- 16
- 37
0
votes
1 answer
Move model first to code first EF 5
How can I move from Model First approach to Code First approach of Entity Framework development? I need it to enable EF Migrations.
0
votes
2 answers
Location of EntityFramework T4 templates
When you do database-first or model-first (EDMX) in EntityFramework, I believe Visual Studio generates code off T4 templates, I would like to create a new out of the default and throw some customization in but I can't find their location anywhere.

Pierluc SS
- 3,138
- 7
- 31
- 44
0
votes
1 answer
How to handle cascading deletes on inherited tables?
I've run into a problem with ON DELETE CASCADE when using inherited tables.
I've got the following tables (model first)
Now if I want to delete an entry in Entity1.
using (var ctx = new MyEntities())
{
var first = ctx.Entity1Set.First();
…

Snæbjørn
- 10,322
- 14
- 65
- 124
0
votes
1 answer
Entity Framework Generate Database Schema (SQL) with Default Table Values
I am using EF 5 and SQL Server 2005, Model First (sort of).
By sort of, I mean that I typically build my schema in the SQL Server designer, but import the schema into EF so I have a visual view. There is often round-tripping.
However, I noticed that…

NightOwl888
- 55,572
- 24
- 139
- 212
0
votes
1 answer
EDMX designer custom association
I have a problem with edmx desginer. I have one table (Comment) and one view (User). I want to add association between them, UserId in Comment. When I'm doing it I get additional column in Comment - UserId1. And after that i have error, that…

Paweł Reszka
- 1,557
- 4
- 20
- 41
0
votes
1 answer
Repository pattern in entity framework model-first design
I could not find any exact information which platforms are suitable for repository pattern implementation. I have a MySQL DB and console app that is written in VS 2010. I am using Entity Framework 4 and my database is imported to VS project by…

sanchop22
- 2,729
- 12
- 43
- 66
0
votes
1 answer
EntityFramework Model First, Composite Primary Key From Foreign Keys
I have a Entity Framework 5 Model First project, with the following tables:
Extension
Id : Int32, PK
Number: String
User
Id: Int32, PK
Name: String
UserExtensionMap
UserId : Int32 (FK -> User.Id), PK
ExtensionId : Int32 (FK ->…

morleyc
- 2,169
- 10
- 48
- 108
0
votes
2 answers
Visual Studio 2012 and EF5 Development on non-Windows 8 Machine
Am trying to create an EF5 Model First project at work.
After i created the model and clicked generate database from model, at first it wasn't creating the code behind. Looking a bit i found the Code Generation Strategy was set to none. I set it to…

537mfb
- 1,374
- 1
- 16
- 32
0
votes
1 answer
Entity framework: Manually maintained mappings
I've been using EF for a while (4 with model first) and so far I've not created any mapping manually. Whenever I need more entities/tables, I add an entity and the associations (all foreign key) and click "update database from model", which, as is…

John
- 6,693
- 3
- 51
- 90