Category "entity-framework-core"

Does not contain definition for "HasDefaultValue"

I want to set a default value for a non nullable field in code first. I have included Microsoft.EntityFrameworkCore but I'm still getting Does not contain

Microsoft.EntityFrameworkCore.Internal.DiagnosticsLogger`1'

I m trying to migrate my data base using EF core when i run this commande "dotnet ef migrations add Init --context PersistedGrantDbContext -o Migrations/Persis

Entity Framework Core too slow on First call

I have around 40 entities and everytime after I compile and run my app it takes almost 10 seconds whenever DbContext is called for the first time. Is there a wa

Entity Framework Core 5 and CosmosDB SQL API - Include extension method does not work

I have followed the steps from the following EF Core 5 site in order to store and read items from the CosmosDB. Here is the site: https://www.learnentityframewo

EFCore join values

I'm trying to join a big table to a small list of data pairs using EFCore 2.1.1. I want this join to happen server-side, rather than trying to download the who

Storing DateTimeOffset value without milliseconds in SQL Server using EF Core

Say I create a DateTimeOffset value like this: var dt = DateTimeOffset.UtcNow; And I want to store this value in SQL Server using EF Core code-first. How do I

Intercept saving of entities in Entity Framework Core

Is there a way for EF Core to intercept the pre insertion, pre update, pre delete, post insert, post update and post delete events of an entity? EF core support

Check if todays date exists in a table with Entity Framework

I have a database table with columns of type dateTime. Now I need to see if there already is a row with today's date, but I don't know how to compare the column

Entity Framework CORE Seeding Joining table

I am working on .NET CORE 6 along with EF CORE 7. I need to seed data in joining table but unable to do so and get error. I am seed FileTypeId but not sure why

Scaffold-DbContext runs successfully but does not create any models

I am using Visual Studio community edition 2022 and trying to update my Models from database in EntityFrameworkCore 6 (I added new tables and modified some). Wh

How to write Repository method for .ThenInclude in EF Core 2

I'm trying to write a repository method for Entity Framework Core 2.0 that can handle returning child collections of properties using .ThenInclude, but I'm havi

Lazy loading in EFCore loads all the data even if not accessed

I have been trying to use lazy loading in ASP.NET core 6, I have followed the documentation to do so. However, the behavior of the lazy loading is not the same

Why is my Blazor Server App waiting to render until data has been retrieved, even when using async?

I'm building a Blazor Server app using .NET 6. As an example I have a list of customers that I retrieve from a Sqlite db using Entityframework Core. I want to s

A fatal error occurred. The required library libhostfxr.dylib could not be found

I'm working on ASP.NET Project with .NET 5.0. For Database creation, I've run the command dotnet tool install --global dotnet-ef After the installing, when I

The property 'PropertyName' could not be mapped, because it is of type 'List<decimal>'

I got this problem when I try to create the database with EntityFramework Core: The property 'Rating.RatingScores' could not be mapped, because it is of typ

Microsoft.Extensions.Hosting.HostFactoryResolver+HostingListener+StopTheHostException

I'm using Asp.Net Core Web Api 6 I'm facing an error when migrating my DbContext and when updating the database The Error [17:07:29 INF] Application Is Starting

options.UseSqlServer returns Error in startup.cs

I'm developing a test Project using asp.net core. For Connecting to database I'm using Entity framework. I add appsetings.json file to the project and change th

EF Core 2.1 - No database provider has been configured for this DbContext

I have ASP.Net Core 2.1 with EF Core 2.1. This is how my DbContext class looks like app.DAL.EF -> Layer using app.domain; using Microsoft.EntityFrameworkCo

Problem Changing the value of nested ValueObject using C# 10, .NET 6 and EF Core 6

My Aggregate is like this: public class Order : AggregateRoot { private readonly List<OrderItem> _items = new(); public DateTime Date { get; set;

Update ContextModelSnapshot EF Core

I'm newer to EF Core, so please forgive me if there is a trivial answer. Take this scenario.... A new web-application is being developed using the latest vers