Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [entity-framework-core]

Entity Framework (EF) Core is a lightweight, extensible, and cross-platform version of the popular Entity Framework data access technology.

Filter by
Sorted by
Tagged with
8
votes
1answer
95 views

Shopping cart purchase method in service layer

The following is a class in the service layer of an ASP.NET Core web application, which currently contains a single method: PurchaseCart. The intention is that an ID is passed in to a "shopping cart" ...
6
votes
2answers
157 views

Asynchronous IBAN API with validation

I am working on an iban api which is about saving the iban of some members after (iban validation) in a database. The code is split between Domain (entities, behaviour for iban validation), Database ...
6
votes
1answer
2k views

Preventing duplicate key errors in EF-Core InMemory provider through locking

I have a rest service on Azure AD that calls other rest services. They use AzureAd authentication and AuthContext with a custom TokenCache that stores each users ...
6
votes
1answer
103 views

Retrieving the IDs of entries to be deleted from a table

Business logic It would take us too far to explain the whole business case behind this code, so I'll try to be as succinct as possible. There are Persons, and ...
5
votes
1answer
52 views

Prepare and export data to MS Word file

The task of the code that is presented for review is to prepare all the data for the export of the selected contract and create a file on this basis. This is one of the first experiences with a ...
4
votes
3answers
179 views

Web-app for tracking containers

Nowadays I am learning Domain Driven Design intensively. I am reading the book called Domain Driven Design by Eric Evans, and at the same time I try to apply the knowledge on a real life project I ...
4
votes
1answer
2k views

Linked List implementation Entity Framework Core

I am trying to create a data model where there are Document entities, which need to be in a defined order to each other. Think of an article that has sections which ...
3
votes
1answer
1k views

Enum synced with Database

Our database has several tables that have a value that can be one of 4 things, so we made these columns instead have an id column with a foreign key to an enum table with an id and a value column to ...
3
votes
1answer
210 views

Bank ATM Mockup App

This is a follow-up on bank ATM mockup app in .NET Core framework and Entity Framework Core. I have 2 user interfaces: Console and Web. Previously I have UOW and repository layer but I have removed ...
3
votes
1answer
777 views

Get all children recursively in Entity Framework Core

In Entity Framework Core we can have recursive entities. But we cannot do an "Include" for these recursives (can we?). So I wrote a Get-method that does it for me: ...
2
votes
1answer
596 views

Web Service that gets data from multiple tables in a database using EF Core Database-First approach

I have never created a web service before. I followed most of this Pluralsight tutorial to give me an idea of how to create one using ASP.NET MVC along with .NET Core 2.0 and Entity Framework Core. ...
2
votes
1answer
283 views

Applying EF core in Universal Windows Apps using a large database

I am building my UWP app and really stuck in the architecture. For the past few days, I have been reading MVVM, Entity Framework, SQLite, Code First, etc and I am confused how I will implement ...
2
votes
0answers
53 views

Querying based on condition

I am using Entity Framework Core as ORM in my ASP.NET Core 2.1 project. I want to perform server-side pagination in Career Controller for getting list of careers. I have a model which looks like: <...
2
votes
0answers
1k views

Create a hierarchical tree with ordering field with entiry framework core

This is my model: ...
1
vote
1answer
6k views

EF entity, extended with partial classes for actions

Me colleague and I recently had a discussion on good practices in EF. So I showed one of mine. He said it is a little bit muddler. My practice consists of modifying the autogenerated class in a ...
1
vote
0answers
76 views

Persist payload containing multiple items using EF Core Performance Improvements

I have an .NET Core EF application, setup as Database first, that is supposed to take in a payload containing items to be persisted to my database. They payloads can be huge containing multiple "...
1
vote
0answers
415 views

Selecting coins with alert count by using a subquery

I have a table called alerts and is related to a table called coin (coin can have many alerts). I would like to return a list of alerts but also return a subquery count of how many alerts that coin ...
1
vote
0answers
76 views

Loop through records, change property of records, send mail for each

I am trying to basically do the following Get record from db. Loop through records and send mail out for each record. Update database records. I would like to know what is the most optimal way to do ...
1
vote
0answers
381 views

ASP.NET Core basic login implementation

I'm fairly new to ASP.NET Core, I've used webforms for years so I naturally want to cling to things I did with webforms. The following code works, but I'm wondering if it can be cleaned up with ...
1
vote
0answers
509 views

BaseRepository for EntityFrameworkCode

I want to create some BaseRepository for EntityFrameworkCode and I've tried construct this Repository based on code from ...
0
votes
2answers
2k views

Is it fine to use my domain model as DTO (Entity Framework Core)? [closed]

I was reading about anemic data models and rich domain models in DDD. I don't want to follow DDD completely but take rather pragmatic approach and just take some concepts out of it because clean ddd ...
0
votes
1answer
416 views

Configuring certificate signing for development and production environments

The below code works but there's a lot of duplication I wonder if I can get around. I would like to be able to use .AddDeveloperSigningCredential(false) if in ...
0
votes
1answer
643 views

EF Core Complex Query Method

The code is returning reviews based on users like status order. It seems it executes a lot of SQL queries, so do you think it can be simplified and can it be a headache to server performance? ...
0
votes
0answers
89 views

Bank ATM App Mockup - Implementing Domain-Driven Design (DDD)

There is a follow-up on this question. I have created this bank ATM app mockup which I believe implement some Domain-Design Design layered architecture, repository pattern and uow pattern, if not ...
0
votes
0answers
216 views

.NET core controller method to populate jQuery datatable of users and roles

I want to know whether I am following the best practices of using jquery datatable with .net core. In Controller ...
-1
votes
1answer
87 views

Handling Entity Framework in connected mode within Windows Forms [closed]

I know the difference between the Entity Framework connected mode vs disconnected mode. In connected mode we do all the stuff inside one single DbContext instance. ...