Category "entity-framework-core"

C# - Adding condition to func results in stack overflow exception

I have a func as part of specification class which sorts the given iqueryable Func<IQueryable<T>, IOrderedQueryable<T>>? Sort { get; set; } W

In Entity Framework Core 3.1, what is the best way to dynamically provide table name to a query?

I have seen options for .NET 5, .NET Core 2.0, etc. but none of them seem to work for .NET Core 3.1 What is the best way to provide table name, in a variable, t

How can I learn the credentials for the Connection String in optionsBuilder.UseOracle(@"User Id=<>;Password=<>;Data Source=<>")?

I want to connect from my codebase which is console C# project to an Oracle database. I am using Entity Framework Core 6.0: using Microsoft.EntityFrameworkC

.NET6 calling oracle stored procedures with params and refcursor

First time I am using .net6 with entity framework trying to call stored procedure. CREATE OR REPLACE PROCEDURE get_registration ( IDIn IN Number DEFAULT nu

Audit.Net: Audit Record Not Rolling Back When saving master record throws DbUpdateException

I have been using Audit.EntityFramework.Core v14.6.3 in my .Net Core v2.2 Web API. When I update a table record, it threw dbUpdateException error due to a check

Register to be created from factory

I'm trying to use DryIOC to resolve a scoped entity framework context. While this registration works, it feels weird: container.Register<MyDbContext>( Reu

EF Core - ValueConverter or OwnedType for simple ValueObjects?

I use value objects to encapsulate validations like maxLength. This is an extract of a sample class without factory method and validation: public class CallingN

How to insert properly into a many-to-many relationship?

When inserting data into a many-to-many relationship, should you insert to the join-table or to both original tables? My table models: public DbSet<User>

How to connect to MySQL server using Entity Framework Core

I am using Visual Studio 2019 community edition. I want to connect to MySQL using Entity Framework core. I do not want to use Entity Framework 6. I am running i

Returning ID from not yet created linked table index

I'm currently working on the database integration of my internship project using EntityFrameworkCore.Jet version 3.11. I cant upgrade because I'm using an MS Ac

Is Using EF Core Value Converter Preventing the Contains() LINQ Method from being Translated to SQL?

I have a Movie class. It has a Genres property of type List<string>. I use this exact EF Core Value Conversion to store it in the database as a comma-sepa

GetColumnName() in EF Core 6 returns property name not mapped column name

I'm using EF Core 6 (6.0.2) with SQL Server 2019 with the following entity: public partial class MyEntity { [Column("External_ExternalId")] publ

EF Scaffold table name is null

I'm trying to reverse engineer a Firebird 3 database using dotnet-ef scaffold. I tried it using EF Core 5 and EF Core 6. Both do not work but for different reas

Using EF Core with WPF and I'd like to revert to initial state when a user press Cancel instead of OK on a dialog, is that possible and how?

I'm using EF Core with WPF and I'd like to revert any changes done on any objects to their initial state when a user press Cancel instead of OK on a dialog, is

Entity Framework Core child entities only show up when I debug through code

I'm having this really weird scenario where I have a component in MVC that will call a service to grab all the categories in the database and include its child

Entity Framework Core child entities only show up when I debug through code

I'm having this really weird scenario where I have a component in MVC that will call a service to grab all the categories in the database and include its child

i can not pass parameters to backend ( from Ajax to IActionResult or JsonResult) .net core 5

i have problem i can't pass params to backend use fech or ajax call , but from another PC i can pass params, here is a sample from code Backend : [HttpPost]

How can I convert an empty string value to a nullable date value?

When I use Postman to test my API with a PUT request, I get this error: "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title": "One or more valid

Entity Framework Core: one-to-one configuration

I updated the title to be more relevant. I have two objects and wish to use EF Core to map them to a database using code first. I have shortened them a bit for

Entity framework core multi tenant : auto increment column based in another column value

Using entity framework core 6 with sample class public class Sample { [Key] public long Id { get; set; } public long TenantId { get; set; } public long