696 questions with Entity Framework Core tags

Sort by: Updated
3 answers

How to connect BlobTrigger Stream of an Sqlite file to Entity Framework Core?

I'm trying to setup an Azure Function in .NET 8 Isolated with a Blob Trigger to read/write to Sqlite files as they're uploaded to the blob. My issue currently, is I can't seem to figure out how to connect the Function's [BlobTrigger(~)] Stream stream…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,298 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,436 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.
10,276 questions
asked 2024-01-02T03:34:41.5066667+00:00
Tyler Mason 45 Reputation points
answered 2024-01-03T12:05:28.7933333+00:00
MayankBargali-MSFT 68,641 Reputation points
3 answers

How to use schema name in EF core autogenerated names?

Hi, I am migrating my project from EntityFramework to EntityFramework Core. What I noticed EF Core has different name convention. When I am generating new migration it is not including schema name. For example, let say Car class will have foreign key to…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 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.
10,276 questions
asked 2023-12-27T11:07:55.9633333+00:00
Paweł Kieliszek 5 Reputation points
answered 2024-01-02T08:57:28.2966667+00:00
Paweł Kieliszek 5 Reputation points
2 answers One of the answers was accepted by the question author.

entity frameowrk

hi iam using dotnet 6 iam new to dotnet can any one tell me is there any way to enable lazy loading for certain queries in dotnet6 s currently enabling globally working its not giving too much improvement in performance and memory use and and also want…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-13T06:37:55.8366667+00:00
usha 100 Reputation points
answered 2024-01-01T09:56:24.57+00:00
ranaali raza 0 Reputation points
1 answer One of the answers was accepted by the question author.

EF Core - How to Exclude a Certain Value Before it's Added to the Database

I would like to exclude two event IDs, 4703 and 5156 so they are not included in the .AddAsync to the Database. We do not need them and there are so many of them in the eventlog. What would be the best/effective way to do that? The event IDs are coming…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,187 questions
asked 2023-12-24T08:18:06.3766667+00:00
muttBunch 60 Reputation points
accepted 2023-12-24T17:00:38.2066667+00:00
muttBunch 60 Reputation points
0 answers

How to I get my Entity Framework Core DbContext to access it's Connection String from Azure Key Vault

Hello I am using the following code in my Program.cs file to successfully retrieve my connection string stored as a secret in Azure Key Vault (something I can see while debugging). The question I have, is how do I get this value securely to my classes…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-13T19:43:22.2666667+00:00
Hunter K 40 Reputation points
commented 2023-12-24T06:26:02.5533333+00:00
2 answers One of the answers was accepted by the question author.

Can you use an array inside of .Contains() via LINQ?

Please see the very bottom in the Answers section from me, I updated question down there rather than removing this here. A co-worker and myself wrote a very small app to store logs in a SQL database for 6 months. I'd like to add filtering parameters to…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
298 questions
asked 2023-12-21T07:32:08.6533333+00:00
muttBunch 60 Reputation points
edited the question 2023-12-23T01:33:34.0533333+00:00
muttBunch 60 Reputation points
1 answer One of the answers was accepted by the question author.

Delete a record with the primary key

Hi; Is there a way to delete a record by its primary key? Yes I know I can do the following: using (var context = new MyDbContext()) { var entity = context.MyEntity.Find(id); context.MyEntity.Remove(entity); context.SaveChanges(); } But I…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-06-05T20:32:22.7166667+00:00
David Thielen 2,281 Reputation points
commented 2023-12-21T03:17:44.6666667+00:00
Trevor Pinkney 0 Reputation points
0 answers

enabling lazy loading for only one query but enabling it enables it for full class as it has only one dbcontext i have set lazy loading globallly false iwant it to work for only one query in dotnet 6

#region Dummy Usings using DummyNamespace1; using DummyNamespace2; using DummyNamespace3; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; #endregion namespace DummyNamespace4 { [UsedImplicitly] public…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-19T13:24:03.0733333+00:00
usha 100 Reputation points
commented 2023-12-20T15:43:14.7233333+00:00
AgaveJoe 26,136 Reputation points
1 answer One of the answers was accepted by the question author.

how to enable lazy loading in dotnet6 for certaion queries as enabling it gloablly intruduces n+1 problem and

hi i am new to dotnet6 pls let me kow how to enable lazy loading in dotnet6 for certaion queries as enabling it gloablly intruduces n+1 problem and reduces performance and iwant thisto enables for certain scenarios

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-15T07:03:01.4066667+00:00
usha 100 Reputation points
accepted 2023-12-18T06:51:32.16+00:00
usha 100 Reputation points
1 answer

What approach should be taken to track changes in database operations in other windows?

Hello I continue to develop an application by injecting services with the MVVM pattern in a C# wpf project. I encountered a problem. I designed a DataAccess class to manage database operations (Insert, delete) with EF. A new record is added in a window…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,676 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.
10,276 questions
asked 2023-12-15T07:43:30.5366667+00:00
fatih uyanık 80 Reputation points
commented 2023-12-18T06:09:38.6066667+00:00
Peter Fleischer (former MVP) 19,231 Reputation points
2 answers One of the answers was accepted by the question author.

Does Timed Trigger Azure Function in Isolated Process support identity-based sql connection for EF6

Hi! So I have a simple .NET6 Azure Function (v4) isolated process with TimerTrigger which connect to an Azure SQL database with Entity Framework. The problem is that it can't connect to the database using managed identity the same way I did for Azure App…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,298 questions
Microsoft Entra
asked 2023-12-11T16:47:00.9166667+00:00
Jacques Boivin 25 Reputation points
accepted 2023-12-15T19:31:06.53+00:00
Jacques Boivin 25 Reputation points
4 answers One of the answers was accepted by the question author.

How to use Scaffold-DbContext in .NET Core for SQL Server Compact (*.sdf File) database

I'm using .NET Core Version 7 and I want to use EF Core to access a SQL Server Compact (*.sdf) database file. What libraries to use and how to use Scaffold-DbContext to build the existing database models and also the database has a password. I want to…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 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.
10,276 questions
asked 2023-09-02T13:29:41.3833333+00:00
Mohammad Hasan Salmanian 45 Reputation points
answered 2023-12-14T18:26:21.6+00:00
Nirmala Manipandian 0 Reputation points
1 answer One of the answers was accepted by the question author.

Memory is not releasing in dotnet6

I'm currently working on a .NET 6 Web API project, and I'm facing an issue with memory not being released properly. I have thoroughly analyzed the code and ensured that I'm not creating any memory leaks or holding onto unnecessary resources. However,…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-05T14:48:57.93+00:00
usha 100 Reputation points
commented 2023-12-13T06:28:53.13+00:00
usha 100 Reputation points
0 answers

EF Reverse Engineering can't handle " #" in column name.

I have a database that uses two different fields: string "Asset int "Asset #" After running EF Reverse Engineering on the existing database, it creates a model with: [Column("Asset")] public string Asset {…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-11T05:44:34.2966667+00:00
Bill Duffy 0 Reputation points
commented 2023-12-11T10:45:01.8933333+00:00
Wenbin Geng 711 Reputation points Microsoft Vendor
1 answer

How to pass model's nullable date format data to the view in editable form? problem is when i use input type and use value="" this does not display the datepicker if date is null and if i use this;@Html.TextBoxFor(model => model.ValidFrom, "{0:MM/dd/yyy;

problem is when i use <input class="form-control" value="@(Model.ValidFrom)" name="ValidFrom"> this does not display the datepicker if existing value of date is null and if i use this; @Html.TextBoxFor(model =>…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,187 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,270 questions
asked 2023-12-10T12:01:20.94+00:00
Milan Bishowkarma 0 Reputation points
edited the question 2023-12-11T01:17:37.4066667+00:00
XuDong Peng-MSFT 10,101 Reputation points Microsoft Vendor
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…

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.
617 questions
Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,187 questions
asked 2022-12-22T14:03:01.62+00:00
Mohammad Arar (MiddleEast) 21 Reputation points
commented 2023-12-09T06:58:26.5266667+00:00
Abdullah 0 Reputation points
2 answers

How can I get an IUpdateEntry from a DbContext for a object that is read?

Hi all; I need to create a DbUpdateConcurrencyException and pass it the IUpdateEntry for the object I just had returned by dbContext.Events.FirstOrDefaultAsync(e => e.Id == entity.Id) I am throwing it if the rowversion has been updated over the value…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-07T23:30:25.3266667+00:00
David Thielen 2,281 Reputation points
answered 2023-12-08T17:27:46.0133333+00:00
David Thielen 2,281 Reputation points
0 answers

How do I create an optional 1:1 relationship in EF Core where neither side is dependent on the other?

I have a Device model, and a Tid model. Devices and TIDs can exist independently of each other, or can be associated together. If associated, then exactly one device can be associated with exactly one TID. For this I need a nullable one-to-one…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-04T21:41:39.9533333+00:00
Yossu 11 Reputation points
commented 2023-12-07T07:48:24.0333333+00:00
LTDan 5 Reputation points
0 answers

EF Core .Net 8 error after TLS 1.0 was disabled.

The admins where I work have disabled TLS 1.0 but now all of a sudden, my .Net 8 app is getting the following error: Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 questions
asked 2023-12-05T17:06:22.9333333+00:00
Lange Gregory 20 Reputation points
commented 2023-12-07T07:05:50.1166667+00:00
Wenbin Geng 711 Reputation points Microsoft Vendor
2 answers

Getting an error :Add-Migration : The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Tried trouble shooting , verfied DB context class. Reinstalled Vs after troubleshooting and getting answers saying there is a problem with package manager .

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
696 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.
12,756 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.
10,276 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,215 questions
asked 2023-05-19T13:51:47.28+00:00
Shyamali Mishra 0 Reputation points
commented 2023-12-06T08:42:57.7166667+00:00
Erik Thysell 1 Reputation point