Questions tagged [ef-database-first]

The Database First Approach of Entity Framework provides an alternative to the Code First and Model First approaches to the Entity Data Model and it creates model codes (classes, properties, DbContext etc.) from an existing database.

The Database First Approach of Entity Framework provides an alternative to the Code First and Model First approaches to the Entity Data Model and it creates model codes (classes, properties, DbContext etc.) from an existing database.

731 questions
-1
votes
1 answer

entity framework 6 and database first

I have searched in different forums about T4 and EF6, but cant figure out properly how to do a database first approach in visual studio 2013 using entity framework 6. When I try to add a ADO.NET entity data model it creates an empty .edmx file. Is…
-1
votes
1 answer

How can I add a property to a database first Model that is not going to be part of the Database

I am trying to set up a database first project to handle the data access for a database that is common to several applications that use. The value of these properties will be set differently based on the method called, who is calling, etc. Is…
Chad
  • 1,512
  • 1
  • 16
  • 40
-1
votes
1 answer

How to make changes in Database First code to make it working with Code First

i am having trouble in changing code from database first to code first.I was implementing this blog post http://techbrij.com/facebook-wall-posts-comments-knockout-aspnet-webapi. First trouble is with database generated from code first.It is creating…
-1
votes
1 answer

EntityType 'UserLogins' has no key defined. Define the key for this EntityType

I'm trying to map my ASP.NET identity classes to my database tables but I get a ModelValidationException that says "TestJam.UserLogins: : EntityType 'UserLogins' has no key defined. Define the key for this EntityType. UserLogins: EntityType:…
-1
votes
2 answers

How can I configure entity framework to use a different connection string depending on its environment?

My company uses different databases depending on which stage of development a project is in. Currently I'm trying to push for adoption of Entity Framework + LINQ but have hit a stumbling block when asked how this would work across our multiple…
-2
votes
0 answers

How to use Scaffold-DbContext in .NET Core for Sqlite database

I am using .NET Core 7 and I want to use EF Core to access a Sqlite (*.db3) database file. This file has a password and I want to add the database tables to the project through database first. The scaffold-dbcontext code is as follows, but it gives…
-2
votes
1 answer

Database-first project: missing CSDL file prevents project being built

Current project: DotNet 4.7.1 MVC 5 Database-first from a legacy DB, [DbName].edmx file in /Models/ When trying to build the project in order to test it, I am getting a sudden error (CS1566) that there was an error reading the resource…
René Kåbis
  • 842
  • 2
  • 9
  • 28
-2
votes
1 answer

How to use built-in membership in asp.net mvc

I'm using Visual Studio 2015, then i created a new project with authentication of individual users account. I want to use built-in membership (account and manage controller) and manage them in sql server management studio, because i will use…
askm
  • 195
  • 1
  • 7
  • 19
-2
votes
1 answer

How can i send checked value of checkbox? I want to send checkbox value to controller and save changes in database

How can i get checkbox values in controller mvc 4 ? I want to send checkbox value to controller and save changes in database. I am using Entity Framework 4.5 and MVC4 databasefirst.
-4
votes
1 answer

Many to Many in database first approach mvc crud operation

How to use many to many relationship in mvc database first approach. I am having following table structure in sql Table 1:- studentMaster Table 2:- Subjects My Model1.edmx and sql table structure pic is here…
-4
votes
2 answers

why my query doesn't work correctly?

hi i used this query for update my db but not working : if (Request["mode"] != null) { Int32 ID = Int32.Parse(Request["Id"].ToString()); using (NoavaranModel.NoavaranEntities1 dbContext = new…
Sirwan Afifi
  • 10,654
  • 14
  • 63
  • 110
1 2 3
48
49