Questions tagged [.net]
The .NET Framework is a software framework for Microsoft Windows operating systems. It includes an implementation of the Base Class Library, Common Language Runtime, and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++.
1,461
questions
13
votes
4
answers
3k
views
How to name uppercase variables when using the camelCase convention?
I am writing a C# class and one of the fields is an API endpoint. Being that API is an acronym and is written in all uppercase letters, what is the correct way to name the field _APIEndpoint, ...
0
votes
3
answers
139
views
.Net 8 XUnit: How to mock MySql in a CQRS API using integration tests?
This is a rewrite of my own
.Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS?
in a much more clear way:
The reason for rewriting my previous question is because in the ...
3
votes
2
answers
359
views
.Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS?
I'm creating tests for our .Net 8 API. We use MySql for data storage and CQRS pattern for queries.
In my personal opinion, I shouldn't use the real database for testing, because you will use an ...
0
votes
0
answers
41
views
Split actor model logic into modules
I'm starting a project using .NET and Microsoft Orleans, running on Kubernetes. The main reason I chose Orleans is that I have a system that deals with accounts. There can be millions of accounts, but ...
0
votes
1
answer
74
views
.NET - Communication between services and Power BI
I have the following problem which I don't know much about. I have a ServiceA that returns customer data on transactions and a ServiceB that has reports, also my environment uses Power BI from ...
9
votes
5
answers
4k
views
Writing public libraries: Should I let the consumer of the library enforce thread safety?
I'm writing a .NET library which exposes certain public APIs. Currently, I have not enforced thread safety in my library for following reasons apparent to me:
locks (Monitor.Enter and Monitor.Exit) ...
0
votes
1
answer
131
views
Using a thread-locking service as a singleton dependency in .NET
So I'm working on the Web API for my website and certain API calls need to be performed with thread safety in the application's runtime. I have created a locking service which uses a semaphore for ...
4
votes
1
answer
406
views
Does C# 8 reference type nullability make Option/Result monad obsolete?
As the most common exceptions in my project are NullReferenceExceptions I'm trying to find a way to limit the occurrence of problems with unexpected or unhandled nulls to the minimum.
One of the ...
1
vote
1
answer
103
views
Benefits of resolving dependencies with IServiceCollection and IServiceProvider for Unit Tests instead of inheriting mocks from a base test class
Articles such as this point out some of the pitfalls of manually instantiating dependencies in UTs, while showing some of the benefits of doing it, instead, with the .NET's dependency container by use ...
1
vote
2
answers
180
views
Does my business case need TPL dataflow?
We are trying to rewrite a session management system as our legacy system can't scale up anymore and is quite buggy.
I'll briefly explain our system, we have huge number of machines on which end users ...
0
votes
2
answers
86
views
EFCore In Memory repository Unit Test of Encrypted data
I have in project linq repository unit tests.
[Fact]
public async Task Get_FromTreeEntitiesUnsorted_RetunsOrderByDescending()
{
//Arrange
_contextReadonly.Entity.Add(new ...
-2
votes
1
answer
283
views
How to go about version numbers in a C# solution
My current situation:
I would like to apply this to a solution containing multiple projects (one executable and different libraries) in C#. Additionally, I have a project that packs the executable, ...
-4
votes
1
answer
188
views
How can I manage user data without the login feature? [closed]
I am making a .net Maui QR code business card application and the application will not have authorization features such as member login and registration.
And my app needs to be able to create business ...
0
votes
0
answers
45
views
Automated API Versioning
I did research about this and I'm facing with two challenges:
how to handle version deprecation in my CI/CD pipeline, when we have more than one major versions officially functional and others ...
0
votes
1
answer
33
views
Is using an Azure Function to forward a message to my App Service the best idea for handling a Twilio Web Hook?
I have an Azure App Service running a .NET (Core) API for an inhouse application, which I'm integrating with Twilio to handle Whatsapp communication.
To handle the web hook responsible for receiving a ...