Questions tagged [db-first]

Db-First is an approach used in Entity Framework ORM which means the database tables model comes first than model.

Db-First is an approach used in Entity Framework ORM which means the database tables model comes first than model. In this approach, Entity Framework generates the model from the database tables model.

73 questions
0
votes
1 answer

An exception of type 'System.Data.Entity.Core.MappingException' occurred in EntityFramework.dll but was not handled in user code

I am trying to insert data using this function in entity framework but without MVC protected void SaveBranch_Click(object sender, EventArgs e) { if (DropDownBranchSchool.Text == string.Empty) { } else …
Muhammad Shahid
  • 81
  • 2
  • 12
0
votes
1 answer

SQL Server and Entity Framework Performance Improvement

I'm using SQL Server and Entity Framework as ORM. Currently I have large 5 tables with static data. Actually these table used only for data retrieval process. I ll give good example with my project. This is travel related project and I have to…
0
votes
1 answer

Entity Framework 6 doesn't work with Temporal table

I've Altered an existing table to make it temporal, Then I updated the model from the database. I encountered with these error, with the two new columns I added to the table: Error 3004: Problem in mapping fragments starting at line 1388:No …
mshwf
  • 7,009
  • 12
  • 59
  • 133
0
votes
1 answer

How to change entry values for DbContext.SaveChanges()

We are trying to implement a multi tenant architecture in our Web API based application. We are using RLS in SQL Server, and Subscription_Id is, what is given to each subscriber. We have set the default value for Subscription_Id in SQL Server, so…
0
votes
0 answers

DB first connection string defining

I created windows form application having 3 layers as UI, BLL and DLL. I used DB first methodology. It was created a data model using below steps. ADO.Net entity data model --> EF designer from database --> Then I gave the DB connection. With above…
weeraa
  • 1,123
  • 8
  • 23
  • 40
0
votes
0 answers

EF6 database First check for database schema changes

I have a model.edmx file generated using ef6 database first approach. The database is used by a number of apps and I have no control over when or how the schema may change. There is a GUI wizard to "update model from database" which works for my…
0
votes
0 answers

Invalid Object Name in MVC DB First app

I'm running into a frequent MVC DB first issue where everytime I update my domain model classes from the DB, something always seems to be breaking. In this case, after adding another table and model into my project, running Update model From…
LifeOf0sAnd1s
  • 113
  • 1
  • 11
0
votes
2 answers

Error: A namespace cannot directly contain members such as fields EntityFramework.dll' could not be found

enter image description hereI want to create model: add > class > ado.net entity, for my db first project and also want to create CRUD operation by asp.netscaffolding, but failed to create a model with necessary code.and thus i failed to create…
0
votes
1 answer

ASP.NET Identity 2.0 DB First Approach: Adding new Columns

I am trying to use ASP.NET Identity 2.0 with existing database. I have created an MVC project (which uses Individual Account Authentication), then I registered for a use in order to create the DB. Then: I created scripts for the necessary tables…
0
votes
1 answer

Setting One-One Relationship in DB-First Approach?

I have a table structure as follows FeedbackTable Id Name ... ... ApprovalTable Id FeedbackId ... ... FeedbackTable and ApprovalTable is having 1-1 relation.When i generated Model (using Database First Approach) Feedback model is…
ksg
  • 3,927
  • 7
  • 51
  • 97
0
votes
1 answer

How to refactor web.config in an ASP.NET MVC4 Web App with EF5 and Database First approach?

I started an ASP.NET MVC4 Web App with EF5 and the Db First approach. Now i´ve moved my Models and Context into a MyApp.DataAccess Class Library Project. I added a MyApp.DataAccess reference to MyApp.Web. What do I have to do with my Web.config and…
Frank
  • 1,113
  • 3
  • 14
  • 27
0
votes
3 answers

DB First, MVC 4, CREATE DATABASE permission denied in database 'master'

I keep getting this error on my server when I publish my site - even without changes in database model. The site is running fine local. I'm using the DB first approach. If I delete all files in the site on the server, restore my local database on…
ThorOstergaard
  • 107
  • 2
  • 9
0
votes
1 answer

Entity Framework DB First - Problems with inheritance in the model

I'm facing some problems working with EF DB First. Say I've got: A table Person A table Student with a foreign key pointing to Person A table Teacher with a foreign key pointing to Person The model created from the database generates the next…
jobmo
  • 835
  • 1
  • 9
  • 19
1 2 3 4
5