Questions tagged [ef-model-first]

231 questions
1
vote
1 answer

Designing "hot or not" style database in Entity Framework Model First

I want to design a duel of sorts between movies so that two are pitched against each other, the user selects the better one which then gets a point. In the database I want a list of all movies that have dueled and how many times they have won…
0
votes
1 answer

Entity Framework - Model First, Many-to-Many Mapping

In a database I have two tables User and Organization as well as a bridging table Users_Orgs. The Users_Orgs table has a composite key comprising of two columns userId and organizationId. When I use the designer to create an association it creates…
SamWM
  • 5,196
  • 12
  • 56
  • 85
0
votes
2 answers

how to create cascading ddl's using entity framework model first using MVC3?

I'm new to MVC-entity framework, my model is an entity framework model and I have a commerces table which has a relation with a Province Table which has a relation with Country table. so, when I'm about to create a Commerce, I should be able to…
Gary
  • 602
  • 9
  • 7
0
votes
4 answers

Entity framework model first approach removes all table data

I am studing model first approach in Entity Framework. I found all data gets wiped out whenever a re-generation of the database from the model occurs. Is model-first really a useful approach or is there a way to fix this
Joseph Bi
  • 1,166
  • 2
  • 9
  • 11
0
votes
1 answer

Entity Framework + SQL Azure: best practices for database changes

I'm designing a database that it's not totally defined yet, and as the project goes, it won't be defined very soon. However, the project will be online very soon, and database will be changing online. So, I need be prepared to database changes. Add…
0
votes
1 answer

Is there any package or tool exposing the function to build EF EDMX models from database?

The Visual Studio integrated tool provided by Microsoft is fine but it's not enough for some rare scenarios in which we just want to add new tables (generate EDMX & C# model classes for just those new tables) to the existing entity model but not…
Hopeless
  • 4,397
  • 5
  • 37
  • 64
0
votes
1 answer

Decimal Type Losing All Precision When Adding Via EF4.1 NavigationProperty, Possible Framework Bug?

I've created a sample project which you can download here. Steps to recreate manually: Create new MVC3 web project. Add a .edmx Create an Entity named 'Account.' Create an Entity named 'AccountLineItem.' Add a Decimal field to…
0
votes
0 answers

Nested comments ef core table model returns all comments?

I have blog post model which save comments and replies in same table. public class Comment : Entity, IAggregateRoot { private readonly List _replies; public Comment() { _replies = new List(); } public…
Roshan
  • 3,236
  • 10
  • 41
  • 63
0
votes
1 answer

EFCore Model is invalid. Reference another class from it multiple ways seems to be the problem?

I have a workflow database and part of that is a WORKFLOW_INSTANCE that has many WORKFLOW_STEP_INSTANCE. It works fine until I add the line below. What I am trying to say is there is a one to many but for a single WORKFLOW_INSTANCE I also want to…
punkouter
  • 5,170
  • 15
  • 71
  • 116
0
votes
1 answer

How to create database from "Model first" model?

I have been trying to follow the few tutorials on how to create a DB using the model first approach in MVC. I have gone as far as creating Entities in the designer and trying to generate a DB from the model. It creates SQL file fine but I cant seem…
davey
  • 1,544
  • 4
  • 26
  • 41
0
votes
0 answers

Model first approach, default value of property is not generated in the SQL script

I have a model, developed with Entity Framework 6. I have defined default values for some properties (e.g., True for Property A of type Boolean). When I generate my Database from Model, the default values are not generated in the script. Is there…
Yvonnila
  • 635
  • 1
  • 5
  • 22
0
votes
4 answers

Entity Framework query table with different name

I have a few tables which are exactly the same (except the table name). The data are different, and due to some specific reason, they cannot be merged into one single table. Example: TableA ( Value1 INT NULL, Value2 INT NULL ) TableB ( …
s k
  • 4,342
  • 3
  • 42
  • 61
0
votes
1 answer

Using DataAnnotations and attributes in Model First development

I have been developing my Models "model-first" by using the EDMX designer. I'm rather fond of it, but wondering how I can use this process to apply attributes, specifically DataAnnotations, to my model classes like…
0
votes
1 answer

What's faster EF 4.1 Code First or EF 4.0 Model First?

Are there any performance benefits in either of the methods?
0
votes
1 answer

EF6 - which file based database

I have a following question. I am developing an application for a corporate customer where some data (a kind of a validation rule engine) would need to be stored. In phase 1, the data were not stored, but created as POCOs, so I have a hierarchical…
Petr Osipov
  • 621
  • 6
  • 16