Category "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

IQueryable extension to group dynamicly by minutes ...and other

I wanted to create an IQueryable extension to allow other developers to group entities by minutely interval but also by custom group key result. My idea was to

EF Core - generic way to merge child records based on current db state and equality

I have a scenario where during an Update request of a parent entity, I have a collection of children entities in my dto, and want to merge them in the DB so tha

Database operation expected to affect 1 row(s) but actually affected 0 row(s) entity framework core

I have the following code try { using (var context = await PrepareDatabase()) { // Update temp roles by removing one row, this

EF Core 3, optimize lots of Include/ThenInclude

I have a query like this return await _ctx.Activities .Include(a => a.Attributes) .Include(a => a.Roles) .Include(a =

.NET Core Pomelo Mysql connection

I'm trying to run a Entity Framework command in dotnet cli and I'm getting the following error: Access denied for user ''@'fe80::45b2:4add:f2de:ebcf%6' (using

The entity type 'Access' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'

i have this ValueObject : public class Access : ValueObject<Access> { public string ControllName { get; set; } public string ActionName { get;

Why won't EF Core update this item on my database?

I'm having trouble updating an item on my database. I've tried several different ways, but nothing seems to work. Here is my latest attempt: public async Task

EF Core 6 Seeding Data Gives Foreign Key error Despite Having FK Value

So, I have struggled with this for a while now and can't figure out what I'm missing. I have a table that holds an entity called Skill and the DataModel looks l

EF Core HasData Seeding a TPH Entity

I want to use the EF Core HasData method to seed a database with reference data. Two of the models I want to seed follow the Table per Hierarchy (TPH) pattern i