23,460 questions
0
votes
0
answers
32
views
EF Core view to support updating entry?
I have this view modelled in EF Core:
modelBuilder.Entity<User>(entity =>
{
entity
.HasNoKey()
.ToView("User", "dbo")
}
This ...
-3
votes
0
answers
32
views
What happens if I call saveChanges() on the wrong DbContext? [closed]
I have inherited a project with EF Core in which multiple DbContexts are defined.
In the project there is also a class, called UnitOfWork<T> where T is a DbContext type, which... doesn't really ...
0
votes
1
answer
39
views
EntityFrameworkCore.Identity: Can it be added to an existing project or should I start from scratch?
I'm working on my final year project(fyp) and intended to add an account system using EF Core Identity. When I started my project I found it difficult to get to grasps with the best way to use ...
-1
votes
1
answer
45
views
Why does EF Core delete my other entity when creating a new one? [closed]
I've got this function:
public NetworkUser Create(Guid networkId, Guid userProxyId, CreateNetworkUserDto createNetworkUser)
{
var network = networkService.GetDetailsById(networkId);
var ...
1
vote
1
answer
45
views
How to correctly use AddDbContext as scoped and AddDbContextFactory as singleton simultaneously in ASP.NET Core?
I need to use both AddDbContext<MyContext> (scoped) and AddDbContextFactory<MyContext> (singleton) in my ASP.NET Core application. The DbContextFactory will be used in background tasks, ...
0
votes
1
answer
56
views
Entity Framework Core tries to insert non-existent column 'PecaIdPeca' even with explicit mapping
I'm facing a problem when saving entities with Entity Framework Core 6 (without migrations, SQL Server database).
Even with the explicit mapping of foreign keys, EF Core tries to insert a column that ...
0
votes
0
answers
54
views
Owned collection property not handled as property by EF Core
I already had a question related to this property of mine, and I got bashed by some of the community members on why I expect EF Core to treat a regular property like a regular property and not as a ...
0
votes
0
answers
48
views
EF Core override Identity logic using Interceptor
I am in the early stages of converting an .Net Framework application to .Net 8+. This is a phased project, so at this stage I am trying to move from Entity Framework 6 to EF Core 3.1 (the latest ...
0
votes
0
answers
31
views
Mapping Oracle tables in Entity Framework Core [closed]
I am building an application in ASP.NET Core 8.0 MVC. For data layer and mapping I am going to use Entity Framework Core. There is an existing Oracle database, so I am going to follow a database-first ...
0
votes
0
answers
87
views
Angular 19 returning partially correct DTOs from server eventhough all server data is correct
Return in controller shows "mostly" correct data but when returning it on client side is null.
I use Angular 19, .NET Core and EF Core. The mapping seems to be selective.
I create an Article ...
0
votes
0
answers
22
views
Is there any tool that reads a script.sql and generate a Entity Framework configuration? [closed]
I want to use Entity Framework with a old database. I have the script.sql to create the database. Is there any way or tool that will read the script and generate the EF configuration?
I haven't found ...
0
votes
2
answers
62
views
EF Core doesn't map foreign keys properly when creating new entities
I'm having trouble creating new entities with one-to-one relationships. EF Core is not assigning the foreign keys properly.
As an example, let's take two entities:
public class User
{
public int ...
1
vote
0
answers
62
views
I'm trying to understand TransactionScope and connection pooling
I use TransactionScope and I have problems with understanding what determines transaction promotion to distributed transaction.
With .NET on linux, there is no MSDTC, so such promotion causes an ...
1
vote
0
answers
61
views
Microsoft.EntityFrameworkCore.DbUpdateException ef database table not exists while it exists
I got into this error, While i can confirm I do have the database at the root of my application with the relevant table.
Microsoft.EntityFrameworkCore.DbUpdateException: 'An error occurred
while ...
2
votes
2
answers
94
views
EF Core temporal table on owned entity
I have an EF Core defined table, and a child entity that is configured using OwnsOne without using a secondary table. The properties of the child entity are stored in the same table as the parent ...