743 questions with Entity Framework Core tags

Sort by: Updated
2 answers

Code first Unique constraint on multiple columns

Say I want a Microsoft SQL Server entity as follows: CREATE TABLE [dbo].[Entity]( [ID] [int] IDENTITY(1,1) NOT NULL, [COL1] [nvarchar] NOT NULL, [COL2] [nvarchar] NULL, [COL3] [nvarchar] NULL, CONSTRAINT [PK_Entity] PRIMARY KEY CLUSTERED Then…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
asked 2020-12-06T17:22:22.337+00:00
EuroEager2008 171 Reputation points
commented 2020-12-10T08:00:42.027+00:00
Daniel Zhang-MSFT 9,626 Reputation points
1 answer One of the answers was accepted by the question author.

DbContext lifetime in desktop app with SQLite

I am creating a small data-driven desktop application using .NET 5 with WPF, ReactiveUI, Dynamic Data, and EF Core 5. The app uses a local SQLite database to store all persisted state, and relies heavily on dependency injection. I would like to share…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 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,781 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.
13,865 questions
asked 2020-12-04T01:26:51.93+00:00
mtrainham 21 Reputation points
accepted 2020-12-04T18:28:49.253+00:00
mtrainham 21 Reputation points
1 answer One of the answers was accepted by the question author.

Having trouble with foreign key in entity, can't track because the FK is already part of another object

Scenario: I have an entity that is central to the business, let's call it Company. Entity Foo has FK CompanyID, as does entity Bar. If, within the same context, I retrieve Foo and create an instance of Bar, then try…

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
743 questions
asked 2020-12-01T00:34:30.12+00:00
David Craig 31 Reputation points
commented 2020-12-02T01:17:45.293+00:00
Daniel Zhang-MSFT 9,626 Reputation points