Questions tagged [.net-core]

.NET Core is an open-source, modular implementation of the .NET Framework. It can be used in a wide variety of applications and verticals, ranging from servers and data centers to apps and devices. .NET Core is supported by Microsoft on Windows, Linux and macOS.

Filter by
Sorted by
Tagged with
2
votes
1answer
62 views

Hosted service which perform CRUD operations in high update environment

I have this hosted services which garbs the data from the API and save it in the database. But before saving it checks if the data already exists in the DB if not it creates the new row and if it ...
5
votes
1answer
84 views

Simple HttpClient usage for integration tests in .NET Core

I have this simple setup for a .NET Core project which is just a very basic HttpClient usage to do some simple integration tests to a RESTful API. For now the test project remains separated from the ...
8
votes
5answers
2k views

Bidirectional Dictionary

The management of bidirectional mappings is a reoccuring topic. I took the time to write an (hopefully) efficient implementation. ...
6
votes
0answers
88 views

Single-threaded fully asynchronous server, with a SocketSelector that dispatches events

I need a fully asynchronous single-threaded server written using .Net Core. Searched for options and, surprisingly, did't find any. So I decided to write a simple prototype. Borrowed idea from python'...
2
votes
0answers
28 views

F# XML Generation in .NET Core: XmlSerializer or XmlProvider

I am working on SEPA XML generator in F#. I developed two solutions that are roughly equivalent, one relies on the XmlSerializer while the other relies on ...
12
votes
5answers
702 views

Reducing contention in thread-safe LruCache

I was looking for a in-memory cache class, but couldn't find any in the .Net Core framework; luckily I found one already implemented here. I made some minor modifications to it and tried to make it ...
1
vote
1answer
45 views

Idiomatic way to write proper F# (x)unit + fsunit tests?

I am writing some unit tests using XUnit in F# and I am wondering what is the most idiomatic way in the F# sense to write them. Let's start a simple case: ...
2
votes
0answers
49 views

Own Authorization attribute

In the existing system, we need to rebuild the user's authorization. The database includes Roles and Rights Roles were previously used but will be skipped in the new version All authorization will ...
2
votes
2answers
157 views

Geektrust: Modelling Family Relationships in a OO way

I'm trying to model family relationships in a OO way, i.e. As we update the relationships between two individuals our model must be able to find the people given a person and the type of relationship ...
2
votes
1answer
80 views

Periodically sending data from database to an API

I'm trying to make a timed background service in .NET Core (I found this approach in Microsoft Docs), that every 15 seconds it gets data from the database (1000 rows max, if something exists) then ...
3
votes
1answer
438 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: ...
-1
votes
1answer
61 views

Huge performance difference: PowerShell Core vs. 5.1 [closed]

Recently I have answered another question about performance. A solution found using PowerShell-ISE successfully, and good speed testified using PowerShell Core. However, running the same script(s) in ...
1
vote
1answer
71 views

Memory policy with ArrayPool<T>.Shared

i've recently released a from scratch set of library Astron, and I wanted to get my memory policy logic reviewed.(you can find a little doc about it here). My first goal was to provide an extandable ...
7
votes
1answer
258 views

Usage of TPL vs Parallel.ForEach() on file processing

i've been working on an implementation of a my own from scratch set of library Astron and I wanted to get my TPL usage reviewed because i'm not confident with this technology :/ My app is currently ...
3
votes
1answer
127 views

Building QueryString from custom object

I have a custom object that is based in the following models: ...
2
votes
1answer
952 views

ASP.NET Core Request / Response logging middleware

I am looking for feedbacks about my ASP.NET Core Request / Response logging middleware, in particular in ways to lower the memory footprint and string allocations: ...
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
1answer
131 views

IEnumerable<T> async serialization

I am building some classes to serialize (in an async / await way) potentially pretty long ...
-2
votes
1answer
65 views

AspNetCore - Injecting a Func<T> [closed]

I have an ASP.NET Core controller I am creating. The controller endpoint looks something like this right now: ...
1
vote
0answers
318 views

Include Serilog sink requiring dependency before dependency injection in .NET Core

Here is a rundown of the situation This is a .Net Core (2.1) application with a console and web front ends. For simplicity this question focuses only on the console end although the web end has the ...
0
votes
0answers
203 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 ...
3
votes
0answers
48 views

Generic library for querying various kinds of databases

Since C# 8 and .Net Core 3 are going to be released sometime this year, I wanted to try and convert the library I made to make querying databases easier, implementing the already accepted features (...
2
votes
1answer
55 views

Revision: BinaryTree<T> written in C#

Since my last question (BinaryTree<T> written in C#), I have rewritten my code based on the responses. My project can be found on my GitHub repo here; ...
11
votes
2answers
2k views

BinaryTree<T> written in C#

I've written a binary-tree using .NET Core 3.0. What can I do to improve my coding style? ...
0
votes
0answers
307 views

Upsert with .Net Core Web API

I am using .NET Core 2.2, EF Core and C#. I have created a web API project. I was requested to do an Upsert (insert or update). The entities structure is: Movie User Rating: this is used to give a ...
-2
votes
1answer
146 views

Repository Pattern and SOLID principles [closed]

I have written the following Repository in C#, using NetCore 2.2 and EF Core. I was thinking how to write properly the Search method according to the SOLID principles. This code gives a null ...
4
votes
2answers
316 views

Reading SQL query from a resource, with error logging

I've created a utility class that expects a logger to be passed at a method level, since I prefer legitimate errors to be written out for troubleshooting later on. Another developer hates passing the ...
5
votes
1answer
1k views

Using Span<> and Memory<> to read UTF8 from a socket

I am experimenting with Span<> and Memory<> and checking how to use it for example for reading UTF8 text from a <...
-1
votes
1answer
232 views

Creating a Compatibility Shim for ExampleClass to be targeted both to .net framework and .net core 2.0

Intro: Before showing the actual code for review, let me show you an ExampleClass to create a shim for. ...
2
votes
1answer
120 views

Retrieving OS Platform .NET Core

I'm retrieving the operating system platform with .NET Core with system.runtime.interopservicesI have created the code below and was wondering if there was any other way that I could improve it since ...
0
votes
1answer
659 views

Mocking objects using abstract factory

For some time I am trying to make a mocking library for C# that mocks objects with just 1 line of code. I am using abstract factory pattern to know what is the object's type so that I can work with ...
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 ...
5
votes
1answer
3k views

File path unified in Windows/MacOS/Linux

We are all tremendously happy about back slashes in Windows file systems and do not think that their sole purpose is to make life complicated for smart people who are capable of using different OS. ...
4
votes
0answers
884 views

CSV Data Table Extension

This is my library I wrote from scratch for the .net core that imports and exports CSVs from DataTable objects. I've seen a lot of huge complicated libraries that handle this and a million other ...