Questions tagged [database-first]
171 questions
1
vote
3 answers
How to change generated class names generated using Entity Framework Power Tools
Guys am working on an Asp.Net MVC project that already is using a repository pattern for fetching data from MS SQL Server database.
I now intend to use Entity Framework for some new particular requirement of our project without disturbing the old…

Faisal Mq
- 5,036
- 4
- 35
- 39
1
vote
1 answer
EF Database first many to many with additional field
Now this is probably a silly issue but it's giving me quite a headache.
What I'm trying to accomplish is for EF to generate 2 objects with M-M relationship.
Material and Product.
A Product has many materials, and one material can be found in…

rexdefuror
- 573
- 2
- 13
- 33
1
vote
3 answers
Connection Strings - MVC Entity Framework - Database First
Can anyone suggest how I could programatically switch debug and live connection strings?
I've seen other people have passed an EntityConnection to the constructor from the controller like this :
private XYZDatabase db = new…

Mike
- 369
- 1
- 6
- 24
1
vote
2 answers
Moving EF 5 Database first Poco classes to separate project vs2012 EF5
I've seen several answers on this question on how to one can move the model.tt (which contains the POCO entity classes ) file to a separate project in Vs2010
This doesn't seem to work in EF5 and it seems like the reason is that the model.tt file is…

Mixitrixi
- 157
- 1
- 10
1
vote
1 answer
DbUpdateConcurrencyException when modifying data
I have been searching around for a bit now. I have tried a couple solutions involving catching the OptimisticConcurrency and adding:
"@Html.HiddenFor(model => model.OrganizationID)"
to my delete page. My index (list), create, and edit pages work…

cfisher
- 235
- 3
- 17
1
vote
2 answers
EF4 db-first: how to add missing relationships
I am using db-first to creating object model for a readonly database, but some relationships are not automatically picked up. For example in Foo.BarId is not automatically connected to Bar object. If I click on BarId property, I don't see anything…

NS.X.
- 2,072
- 5
- 28
- 55
1
vote
2 answers
How to map classes from DBContext Generator to existing POCO domain classes
I'm new to Entity Framework and the database first approach. Can anyone please help me?
Here is the case:
I have a clean, ordinary domain class (Person) with only properties. This class is defined in a VS-project that will only contain domain…

Jo Inge Arnes
- 11
- 1
- 3
1
vote
1 answer
how to use mvc-mini-profiler for database-first entity framework?
I am trying to use mvc-mini-profiler for db-first EF, but it is not working properly.
(note that I'm using objectcontext, not dbcontext)
Here is the list of stackoverflows I've tried:
Setup of mvc-mini-profiler for EF-db- first
How to get…

soleiljy
- 1,121
- 2
- 13
- 20
0
votes
1 answer
C# ASP.NET EF Database first : The type was not mapped
I'm getting mapping errors when running a database first project. I know where I'm supposed to fix them but it's been a while since I've done database first and I can't figure out how to fix it. The more I seem to change things, the more goes…

Reinard
- 3,624
- 10
- 43
- 61
0
votes
2 answers
Entity Framework Code Generation
I'm trying to figure out what the best way to go would be for Entity Framework code generation with a "database first" approach. I want the complete master description of the model to be the actual database schema with annotations stored in database…

Jason Kresowaty
- 16,105
- 9
- 57
- 84
0
votes
1 answer
Tricks to generate List in entity framework as data from similar set of columns
I am developing an silverlight application using WCF and EF.
I am using Database first as our database already exists.
I have a table that consists of 100 columns with datatype real. We want to generate a class which has a List or…

microchip78
- 2,040
- 2
- 28
- 39
0
votes
1 answer
User authentication using Entity Framework in ASP.NET MVC 3
I have an exisiting database which I used to create a Model usign the Database first approach. Please refer to the database diagram.
In my solution file, I have a Class Library of the model which has an ADO.NET connection to the database & and I a…

wackytacky99
- 614
- 1
- 14
- 33
0
votes
2 answers
Bridge table with no primary key
I have a bridge table in my database design and it does not have a primary key. When I try to use the database first approach for ASP.NET MVC 3 to create my model, it creates a model with a warning saying "The table/view…

wackytacky99
- 614
- 1
- 14
- 33
0
votes
2 answers
Replace underscores in Entity Mappings
When using EF4 to create a model, I would like to replace all underscores as well as table/column prefixes so that the model reads cleanly. Our database has a structure something…

mhildreth
- 82
- 7
0
votes
1 answer
EntityFramework fluent API "grandchild" relationship mapping
I'm trying to map what seems like a very common case in the EF fluent API and have hit a wall. I have the following classes:
public class Company
{
public int Id { get; set; }
public virtual List Divisions { get; set; }
public…

R M
- 15
- 2