Category "entity-framework-core"

How to seed in Entity Framework Core 3.0?

I am trying seed the database with some data, using ASP.NET CORE 3.0 and EF Core. I've created my DbContext and according to documentation, online sources, or

why dbcontext.savechanges() donot clear tracked entites of this dbcontext in efcore

I have an error on update entities use efcore and automapper: Entity cannot be tracked because another instance is with the same key value I saw some answers an

.Net Core, Entity Framework Core not working on Linux server

I deployed a test console app to a linux server and everything works fine but when the code execute an Entity Framework Core query, I get this message in the co

Foreign Key word display blank when the app is run

I have built a Book app in ASP.NET Core razor pages CRUD using Entity Framework. However, when I run the app and view it on https://localhost:44370/, the Foreig

EntityFramework is very slow to compare strings because create a nvarchar sqlparameter instead of varchar

I have this sample query: context.BarcodeTipiDoc.AsQueryable().Where(d => d.Barcode.CompareTo(minBarcode) > 0); That query runs very slow because Entit

The corresponding CLR type for entity type 'Employee' is not instantiable

My error: The corresponding CLR type for entity type 'Employee' is not instantiable and there is no derived entity type in the model that corresponds to a conc

Suggested architecture for a project with 2 Frontend applications (Blazor Server and Angular) with EFCore, Identity, Mediatr

I am currently working on a school project with a classmate. We've decided on making the classic setup of an Administration-client (Blazor Server) and a Member-

Sometimes one record from the set does not get into the database using EF Core and TimescaleDB

I faced pretty strange behavior in my tests, when only one record from the set is not added to the database and this happens from time to time, not always. Here

How to insert data into multiple tables with a foreign key using EF core?

What is the best way to insert data into multiple tables with one or more new rcords containing a foreign key to the first table using Entity Framework Core?

EF Core 3.1 The property 'Geometry.UserData' could not be mapped

I have a database-first .net core 3.1 web application which connects to SQL Server database table with a geography column. The database scaffolding and applicat

I got this error "Unable to resolve service for type AspNetCore.Identity.SignInManager" when I use ApplicationUser instead IdentityUser

I have a .NET Core 3.1 Web Api and I created an ApplicationUser class that inherits from IdentityUser because I need to register some others properties. But whe

Error Object Id' is unknown when attempting to save changes. Adding Many to Many to the DB

I have objects with many to many relationship. public class Executor { public long Id { get; set; } public string Name { get; set; } public List&l

EF Core executing previously failed query on SaveChanges

We have a .Net Core 3.1 application which is using EF Core to connect wit the SQL Server database. We are facing one problem, that when an exception occurs in o

EF Core executing previously failed query on SaveChanges

We have a .Net Core 3.1 application which is using EF Core to connect wit the SQL Server database. We are facing one problem, that when an exception occurs in o

EntityFramework Core dbContext doesn't recognize SaveChanges() [closed]

I am working on .NET CORE 6 App along with Entity Framework CORE. I have created DbContext class that I am reference in my abstract BaseComman

No suitable constructor found for entity type string

Yesterday I came her with a similar question about my own made entity type that head some errors. I fixed up these errors but now it throws one on entity type s

Backing up SQLite .db file on ASP .NET Core web server

I'm running a .NET Core wep app. It uses Entity Framework for SQLite. Thus, a .db file is generated. From time to time I want to back up this .db file. Can I d

EF Core xunit assert whether .Include was called

I've got extension methods in .net core that effectively dynamically evaluate stuff, and will call .Include() on an IQueryable<T>. I'd like to build unit

How to use Automapper to project object to Dto in LINQ

I am working on .NET Core 6 along with EF Core. I want to convert Customer and Order object that I have inside LINQ select to CustomerDto and OrderDto using Pro

Can't find single property and navigate related data without IQueryable all properties

I have relational data properties on my objects that I would like to access: public class Person { public ICollection<Address> Addresses { get; private