734 questions
1
vote
1
answer
75
views
Entity Framework 5.0 database first approach unable to update model Visual Studio 2022 due to EntityCommandCompilationException
I am using Entity Framework 5.0 database first approach and I am unable to update model (edmx in Model browser) from database in Visual Studio 2022.
I have 3 models inside my solution and I am able to ...
0
votes
2
answers
212
views
EF Core 8 database first with Identity User tables
I already have a database which contains identity user tables (AspNetUser, AspRole,...). I am using DB first to generate Models, I've configured every necessary services in program.cs. The project ran ...
1
vote
1
answer
131
views
Join with table-valued function via Entity Framework Core 8 using column as parameter
I have a SQL query that uses cross apply to join to a table-valued function to a table as in the following in order to search what is essentially a linked list (parent and child work orders) for the ...
0
votes
0
answers
333
views
Ignore/Exclude Views in Entity Framework Core database-first
I'm using EF Core 8.0.4 and I want to use my existing database. But there are about 1000 views in the database. I don't want to use them for my project anymore. How can I avoid EF Core from ...
0
votes
1
answer
964
views
How do I map foreign keys in Entity Framework Core to an existing database?
Just as a heads up I'm completely new to this and this part has had me stumped for a bit. I haven't found a straight answer that worked (and everything else went right over my head) so please be ...
0
votes
0
answers
124
views
Replace EF Core Default Schema in xUnit
I would like to perform integration testing on my API which connects to an oracle database via EF Core (database-first). Initially, I went with Testcontainers.Oracle but it was running too slow on my ...
1
vote
0
answers
48
views
Entity Framework Core database-first approach [duplicate]
I used database-first approach to create entity data model & context and performed to crud operation.
If a new table (ex: products) has been added to database, please explain how to add the newly ...
0
votes
1
answer
656
views
data type 'bit' is not supported for Entity Framework version using postgresql
I'm stuck updating my .NET Framework 4.8 app, using Entity Framework 6 with a PostgreSQL database which is in the Amazon Aurora Cluster ecosystem.
I'm using the Database First Approach and have Npgsql ...
4
votes
3
answers
5k
views
EF Core 6 startup project doesn't reference EFCore.Design while trying to scaffold to a project that is NOT the startup project
I have a Web API solution with several projects inside it. Tests, Services, Domain, Data and the API. The API project is the startup project. All of my EFCore references are in the Data project.
I am ...
0
votes
0
answers
401
views
How do I keep Entity Framework from saving unmodified navigational properties
EDIT: It was solved by setting
aUpdate.b = null;
aUpdate.c = null;
before calling update. But this does not seem like the right way to do it.
Also, currently the way I'm saving is:
Set.Update(model);
...
2
votes
1
answer
968
views
In .NET EF database-first, is HasIndex() required?
I used Scaffold-DbContext to create an EF Core data model from an SQL Server database, and then went ahead and added many custom attribute decorations and [NotMapped] columns to the model classes, as ...
1
vote
0
answers
583
views
How to handle deadlocks when using C# Entity Framework Database First code?
A common issue I have been running into deadlock exceptions since I'm running constant select statements and update statements via entity framework every second. So here is a simple example of one of ...
0
votes
0
answers
20
views
Entity Framework 6 - How to Update Models from Database - Error [duplicate]
I have an app that is designed using EF 6 database first. When I right click in my EDMX file and click 'Update model From database' the following error occurs:
How do I solve this? Re creating the db ...
0
votes
1
answer
35
views
Modified model that generated from database first approach
Beginner here
Assume that I have a model generated from the database first.
I want to manipulate that model without doing anything to that model.
How can I do that?
I thought about creating another ...
1
vote
1
answer
635
views
Assigning a Property to a Lambda Expression inside an Expression Tree
Background Context:
I am working on a database project that builds models from parsed datasets and then merges these models with the database using Entity and the Entity Framework Extensions (for bulk ...
0
votes
0
answers
82
views
Asp.net MVC Database First : Unable to load the specified metadata resource
Here I'm doing a first-time .net MVC Database First approach project.
I have connected my existing database to the project.
When I try to retrieve the data from it to the controller, I got error ...
1
vote
1
answer
283
views
Automatically turn navigation AutoInclude on when 'Scaffolding' context?
Is there an option to make this automatically? Because I have a database first situation and when I 'Scaffold' my tables the context is setup without this naviagtion. What I do is I put it manually ...
5
votes
2
answers
2k
views
Entity framework Core - Scaffolding enum
Context:
I use Database-first approach to generate my entities with Entity Framework Core and with use of Scaffolding. Each time I change something in the database I run Scaffolding with -f parameter ...
1
vote
1
answer
1k
views
How do I create a Data Access Layer objects from database first approach?
I have built a SQL database with my CustomerDetails, ProductDetails, OrderDetails from scratch and also stored procedures to create new Customers, new Products and Orders.
So now I want to build a ...
3
votes
1
answer
12k
views
Purpose of OnModelCreating - EF Core Database first Approach
I am studying EF Core with database first. There is no issue to get entities and DbContext after reverse-engineering. But I couldn't understand the role(or purpose) OnModelCreating Method in DbContext(...
0
votes
1
answer
286
views
Using database-first approach with string primary key and a one-to-many relationship not working in ASP.NET Core Web API
I have two model classes:
public partial class customer
{
public string customer_id { get; set; } // Primary Key
public string customer_name { get; set; }
public string course_mobile { ...
0
votes
0
answers
239
views
.Net MVC web app - how to dynamically store multiple inputs (within one property) - DatabaseFirst
I may have phrased my question in not the best of ways but here is the problem. I have a table in my View: https://ibb.co/0fXwfPn
Here is the code for said table in the .cshtml : https://ibb.co/...
0
votes
0
answers
29
views
inject connection string with code in database first in EF6
I have several project in my solution and you think there are prjBook and prjLibrary.
I install EF6 on prjBook and added it(prjBook) to prjLibrary as Reference. when run prjBook alone, everything ok ...
0
votes
1
answer
428
views
How to work with an DevArt edml file and start a connection?
I am working with the newest DevArt Oracle version and created a EDML file that connects to my Oracle 12 database and get the models with the db first approach.
I followed this howto:
https://www....
1
vote
2
answers
4k
views
Entity Framework Core database-first selecting specific columns
public Tbl016 CheckLoginCredentials(string UserName, string Password)
{
return
context.Agents
.Where(x => x.LoginName == UserName && x.LoginPassword == ...