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
1
vote
1 answer

EntityFramework DB First Keyword not supported: 'port'

I want make model using db-first entity framwork. so i enter the command like picture below. but the error message shown as Keyword not supported: 'port'. how do i fix this issue. thanks in advance.
1
vote
0 answers

Entity Framework Core 5.0 scaffolding issue in DB first

I'm trying to scaffold a DB model using DB first with Scaffold-DbContext. The error I get is: The types of the properties specified for the foreign key {'PARTNER_GROUP'} on entity type 'PARTNER' do not match the types of the properties in the…
gitzko
  • 33
  • 6
1
vote
0 answers

EF 6 Database first programmatically generate edmx

I'm trying to create the edmx file as part of an automated build process in order to ensure the code is in sync with the DB. The emdx diagram doesn't use the complete DB so I have used EntityStoreSchemaGenerator and EntityModelSchemaGenerator in…
1
vote
2 answers

How to create a column null or not-null dependent on the value of another column?

I'm using database first approach with EF core and trying to figure out a clean solution to the below problem - Consider a Student attendance table (irrelevant columns removed) below that stores date of class and allows the student to enter his…
Achilles
  • 1,099
  • 12
  • 29
1
vote
1 answer

Entity framework 2.1 , 2.2 : Loading related data returns Null or Incomplete

It would really appreciated if you would help me on this. here is the simplified sample : Model:Person public int Id { get; set; } public string Fname { get; set; } public string Lname { get; set; } public ICollection TbContact { get;…
1
vote
1 answer

ExecuteFunction only supports stored procedures and functions that have a return type

I need to call SP from Entity Framework, with DB first approach. Below is the code for it. But i am facing error. "The stored procedure or function 'XXXXXXX' does not have a return type. ExecuteFunction only supports stored procedures and functions…
Umair Akbar
  • 578
  • 5
  • 11
1
vote
1 answer

in Entity Framework, DbSet.Local remains out of sync

This one is making me crasy : I have an EF model built upon a database that contains a table named Category with 6 rows in it. I want to display this in a drop down list in WPF, so I need to bind it to the Categories.Local Observable collection.…
1
vote
1 answer

How to update entity with IntersectionTable in c# ef5 db first approach?

I created my database and started developing a web application in c# with EF5 and the DB First approach. I can modify my entities on their own data fields but don´t get it to work when it comes to updating relationships. A simple relationship…
Frank
  • 1,113
  • 3
  • 14
  • 27
1
vote
1 answer

ASP.NET Core Error while using Scaffold-DbContext

I have Visual Studio 2015 and using ASP.NET Core Web API. I am creating application using database first approach, for that I am using following command in nuget package manager console, Scaffold-DbContext -Connection…
Akash
  • 11
  • 3
1
vote
1 answer

Entity framework with db mode cannot connect to server

I am trying to connect to by db instance using db first, I created a connection
Dmitriy Kovalenko
  • 3,437
  • 3
  • 19
  • 39
1
vote
3 answers

DB First, MVC4, Entity Framework 5 – best practice to display values from multiple tables?

First of all, I´m new to DB First, MVC4, Entity Framework 5 AND especially LINQ. Let´s assume that we have a database with the following tables: T_Project - string ProjectNumber (PK) T_NetworkIpAddress - string IP (PK) - …some more…
Frank
  • 1,113
  • 3
  • 14
  • 27
1
vote
2 answers

How to manage db schema changes in different branches when using db first?

I have an Entity Framework 5 DB-First project, which we're just now migrating from TFS to Git. In TFS we kept the DB up to date using RedGate's SQL Source Control, which was an ok way of doing things, assuming that everyone is developing off trunk…
Shaul Behr
  • 36,951
  • 69
  • 249
  • 387
0
votes
0 answers

A connection was successfully established, but error occurred during the login process

I am facing below error when I am run scaffold-dbcontext command. My command: Scaffold-DbContext "Server=DESKTOP-C2GIJPS\MSSQLSERVER2016;Database=EmployeeDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir…
Shahbaz
  • 1
  • 1
0
votes
0 answers

The problem of using the DB First method in .NET Core 6 using Oracle

I have an application in asp .net core mvc 6 using oracle 11g database. I am using database first approach, when I scaffoled , I get this error: "ThreadID:1 (ERROR) OracleDatabaseModelFactory.Create() : …
n.e
  • 83
  • 1
  • 8
0
votes
0 answers

EF Core Data Annotations - Joining two tables on non-primary keys

How can I define a relationship for two tables where neither of the columns are a primary key and neither follow default conventions? I am struggling to find the right combination of Data Annotations to override the default conventions and join…