Microsoft Q&A

Entity Framework Core

424 questions

A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.

Browse all .NET tags

424 questions with Entity Framework Core tags

Sort by: Updated
2 answers

CreateFunction Like

Hi, I need an example about CreateFunction for like Could you give me an example ? https://learn.microsoft.com/en-us/dotnet/standard/data/sqlite/user-defined-functions

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2023-01-14T18:03:38.4233333+00:00
SUAT SUPHI 21 Reputation points
edited an answer 2023-01-19T09:30:45.19+00:00
Jack J Jun 19,296 Reputation points Microsoft Employee
0 answers

New optional Foreign Key triggers Exception when querying

Hello there! I ran into an issue that I don't understand, therefore here I am. Here is my model: public class Property : FullAuditedEntity<Guid>, IMayHaveTenant { public int? TenantId { get; set; } …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
Entity Framework 6.0
Entity Framework 6.0
A Microsoft open-source object-database mapper for .NET.
218 questions
asked 2023-01-08T19:13:12.307+00:00
Julien CHEVREAU 1 Reputation point
commented 2023-01-19T07:43:30.4066667+00:00
Jack J Jun 19,296 Reputation points Microsoft Employee
5 answers

SQL Bulk Insert Problem while inserting excel data

Hi guys, In my Blazor Server application, I am trying to insert excel data into a SQL database table. I am getting this error, but couldn't figure out why. Hope you can help me. Error: The given ColumnName 'PID' does not match up with any column in data…

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
790 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
8,541 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,979 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2023-01-18T11:41:22.24+00:00
Cenk 666 Reputation points
commented 2023-01-19T06:33:23.6533333+00:00
Cenk 666 Reputation points
1 answer

Blazor Server - SQLBulkCopy Excel data into SQL Server table

Hello folks, I am working on a Blazor server application. There is a requirement to insert excel data (approx. 200000 records) into a table. Is there any tutorial that I can follow? Thank you.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
790 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
8,541 questions
asked 2023-01-17T17:05:52.67+00:00
Cenk 666 Reputation points
commented 2023-01-18T05:19:03.7466667+00:00
Cenk 666 Reputation points
0 answers

EF Model snapshot dev vs prod

Hi, I've an app with EF core, Model First. I created a seed data set for testing my an during the dev phase. I'd like to generate my prod DB, but the dev data are inserted in my prod db. That's an issue... I use the #If DEBUG verb to exclude data from my…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2023-01-12T10:22:25.5+00:00
Laurent Guigon 81 Reputation points
edited a comment 2023-01-12T12:29:02.8833333+00:00
AgaveJoe 17,121 Reputation points
1 answer

EF Core 6 - Auto increment Identity primary key problem

Hi, I have had a Blazor Server application running on production for a while. There is an Orders table, user can insert records. USE [InventoryManagement] GO /****** Object: Table [dbo].[Orders] Script Date: 9.01.2023 14:37:29 ******/ …

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2023-01-09T11:51:49.323+00:00
Cenk 666 Reputation points
answered 2023-01-11T18:34:44.1366667+00:00
Bruce (SqlWork.com) 28,196 Reputation points
0 answers

Huge performance difference - EF Core/Linq/C# vs 'raw SQL'

Hello I have a query using EF Core and Linq in C#. I can paraphrase the query as selecting the average item value for items that appear on an order within a date range (Order has many Items, Item belongs to 1 Order): var q = this.DbSet…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2023-01-06T16:53:17.307+00:00
Matt Gillam 1 Reputation point
commented 2023-01-11T09:27:30.9566667+00:00
Jack J Jun 19,296 Reputation points Microsoft Employee
1 answer One of the answers was accepted by the question author.

Blazor Server IHttpContextAccessor returning null when deployed

I am dynamically setting the connection string based on the user that is logged in. This is working perfectly when running locally/debugging but when its deployed it's returning a null reference exception. This is my DbContext and I am handling the…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
790 questions
asked 2023-01-09T17:22:52.197+00:00
Richard Baker 21 Reputation points
commented 2023-01-10T07:15:20.983+00:00
Richard Baker 21 Reputation points
1 answer

Identity userManager.FindByNameAsync() returns null value

I'm upgrading an old project in asp .net 5 to asp .net 7 and when i try to use userManager.FindByNameAsync() it returns the following exception in the API Response : System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2023-01-04T14:54:40.727+00:00
Ahmed Gamal 11 Reputation points
answered 2023-01-05T09:32:12.79+00:00
Ahmed Gamal 11 Reputation points
3 answers One of the answers was accepted by the question author.

EF Core 6 - DateTime how to set null

Hi, I am trying to set null to a datetime field but unfortunately it is not setting null. public async Task UpdateOrderDetailAsync(OrderDetail orderDetail) { var detail = await…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,979 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2023-01-02T17:50:14.69+00:00
Cenk 666 Reputation points
commented 2023-01-03T22:41:49.423+00:00
Arharbi, Adnane 131 Reputation points
1 answer One of the answers was accepted by the question author.

ASP.NET Core Web API - DateTime Data Annotations Compare dates?

Hello, When the request is made, is there a way to compare with data annotations if the start date is smaller than the end date? Thank you. public class OrderHistoryRequestDto { [Required(ErrorMessage = "Please add…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
asked 2022-12-30T13:53:53.96+00:00
Cenk 666 Reputation points
accepted 2023-01-01T05:05:51.573+00:00
Cenk 666 Reputation points
1 answer

Manage Nuget Packages give Object Reference not set to an instance of an object on Scaffolding

Getting the Object Reference not set to an instance of an object when trying to do scaffolding on a asp.net core mvc project i am working on. I already did the scaffolding when i started the project and now i have updated the database and and i need to…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,979 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2022-11-17T10:57:47.63+00:00
Bar Mashiach 6 Reputation points
answered 2022-12-31T04:13:51.557+00:00
Shivanka de Silva 1 Reputation point
1 answer One of the answers was accepted by the question author.

ASP.NET Core Web API - DateTime Data Annotations Problem

Hello, I am trying to validate an API action method that has a start date and an end date. public class OrderHistoryRequestDto { [Required(ErrorMessage = "Please add StartDate to the request.")] …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2022-12-29T17:25:13.087+00:00
Cenk 666 Reputation points
accepted 2022-12-30T13:50:05.017+00:00
Cenk 666 Reputation points
2 answers One of the answers was accepted by the question author.

What is the problem I have in my project

I SEE THIS ERROR my dbContext : using Microsoft.EntityFrameworkCore; using System.Collections.Generic; using System.Reflection.Metadata; using RepositoryPattern.Models; namespace RepositoryPattern.Data { …

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
600 questions
asked 2022-12-26T19:44:37.22+00:00
SparkCore 21 Reputation points
accepted 2022-12-28T18:56:10.963+00:00
SparkCore 21 Reputation points
1 answer

Does ShardMap support Microsoft.Data.SqlClient package ?

I have an .net core 6.0 entityframework application and want to connect to SQL Database through Azure Active Directory from the application. The code to connect to SQL Database through Azure Active Directory uses Microsoft.Data.SqlClient as the package.…

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,979 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2022-12-27T17:23:28.873+00:00
Aditi Bhalerao 11 Reputation points
answered 2022-12-28T10:30:05.557+00:00
Sami Määttä 1 Reputation point
0 answers

Add-migration Build Failed

When using EF Core 7's Add-Migration cmdlet, I encounter this error: An assembly specified in the application dependencies manifest (MyProject.deps.json) was not found: package: 'runtimepack.Microsoft.Windows.SDK.NET.Ref', version:…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,979 questions
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
435 questions
asked 2022-12-26T16:29:59.61+00:00
Raymart Atienza 1 Reputation point
commented 2022-12-28T08:30:22.927+00:00
Junjie Zhu - MSFT 6,111 Reputation points Microsoft Employee
1 answer One of the answers was accepted by the question author.

EF core, apicontroller validation

Hi all Can someone tell me how validation works with ef core in a webapi controller? I have tried data annotations. They work, but I need additional validation. I tried making metadata classes but they just don’t seem to work. Is there a new…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,979 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2022-12-24T08:05:03.937+00:00
William Buchanan 61 Reputation points
accepted 2022-12-26T23:07:48.327+00:00
William Buchanan 61 Reputation points
2 answers One of the answers was accepted by the question author.

When Extend IdentityUserRole and add migration it create the AspNetUserRole table again

Iam trying to extend the IdentityUserRole entity but when i add migration it recreating the AspNetUserRoles table with the foreign keys also my extend entity: public class ApplicationUserRole: IdentityUserRole<string> { public…

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,565 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
345 questions
asked 2022-12-22T14:03:01.62+00:00
Mohammad Arar (MiddleEast) 21 Reputation points
answered 2022-12-23T11:31:58.74+00:00
Mohammad Arar (MiddleEast) 21 Reputation points
1 answer

VB 2022 & Entity Framework Core Examples

Why I can't find information, document and/or complete examples how to use (configuration, especially with XAML) Visual Basic 2022 with Entity Framework Core on Microsoft web site ? Is somebody have link to find (or a book. But not a general book. I…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
1,830 questions
asked 2022-12-07T07:50:09.243+00:00
Christian 6 Reputation points
commented 2022-12-22T08:48:28.09+00:00
Jack J Jun 19,296 Reputation points Microsoft Employee
1 answer

Error: Introducing FOREIGN KEY constraint

Hi everyone! I have been trying to set up a backend system with dotnet and ran into an issue. Hope you guys could help me here. This is the situation: There are projects, each can have multiple tasks. Tasks can have multiple steps and…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
424 questions
asked 2022-12-08T10:43:13.727+00:00
WDS2022 1 Reputation point
commented 2022-12-22T08:24:10.51+00:00
Lei Zhang-MSFT 6 Reputation points Microsoft Employee