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,474 questions
0
votes
1
answer
75
views
Automated Testing classes with an injected DbContext [duplicate]
I've been working on an implementation of a service, and have found that there are a number of operations where I need to read from a database to provide a caller with certain data or objects.
In-line ...
0
votes
1
answer
155
views
GitHub workflow for .NET desktop apps that supports CI/CD and entity framework
We want a GitHub workflow that syncs EF migrations across all branches and automates ClickOnce desktop app deployments. The key requirements of this question are highlighted in bold at the bottom.
...
1
vote
1
answer
247
views
How to manage connection strings for CI/CD and local debugging that works for .NET Framework web apps and desktop apps?
We want CI/CD to inject the production connection string into a .NET Framework app.config during deployment.
In source control, we only want test/staging DB connection strings.
Developers should ...
2
votes
2
answers
260
views
How should multiple ViewModels communicate in a larger WPF MVVM application?
I’m working on a WPF MVVM application that has grown beyond just one or two User Controls. I now have multiple ViewModels that need to react to each other’s actions (e.g., selecting a customer in one ...
1
vote
3
answers
236
views
Should HTTP clients be encapsulated in a C#/.NET library?
I have a C# library that contains all the logic to send requests to a remote endpoint, including marshalling/unmarshalling and encrypting/decrypting requests and responses. It contains an HttpClient ...
2
votes
3
answers
1k
views
Scope of integration tests
I'm programming a .NET WebApi application from services.
What is the scope of an integration test within the following schema?
Order creation scenario:
Order is created
-> stored in db
-&...
0
votes
2
answers
334
views
C# - Entity handler correct use clean code
I have a question about setting up my service. My main concern is if the design is clean and in order. Whether it meets the SOLID principles and does not spill out on me.
I have entities like order ...
2
votes
1
answer
179
views
Should I split endpoints by parameter requirements?
Preface: This will not be available publicly or to third parties, so I am not concerned about users having the background knowledge to properly form GET requests. These are also not only analytical ...
1
vote
0
answers
104
views
Implementing ServiceLocator in middleware
Before I begin, I'm aware the Service Locator pattern is not recommended and it's better to inject services into the classes where they are used. However, I have a large legacy codebase that creates a ...
1
vote
5
answers
409
views
Conventions and separation of concerns for controllers
I am currently working on a project using .NET APIs and have a few questions regarding controller design. Specifically, I have separate controllers for users and orders, and I am considering the best ...
1
vote
1
answer
159
views
ASP.NET MVC and Web API Together vs. ASP.NET MVC with JSON-Returning Action Methods
In an ASP.NET MVC application with views that make AJAX calls for widgets like dropdowns and data grids, is it better to use Web API controllers or regular MVC action methods that return JSON?
The ...
10
votes
7
answers
4k
views
Does memoization skew benchmarks?
I'm writing a program that works with directed acyclic graphs and performs rewriting operations on them. Sometimes the graphs are small, sometimes they can be very large and grow as the program ...
3
votes
1
answer
410
views
Clean Architecture using interfaces or Mediator approach?
I'm starting a new project and I want to follow a Clean Architecture(ish) approach.
I've modeled my projects in that manner (attached diagram).
For the API I'm using FastEndpoint since I like it, it'...
2
votes
2
answers
492
views
Advanced Scenarios in Clean Architecture
We have a very complex and mature ASP.NET web application that is about 20 years old and has 5 million lines of code spread across roughly 30 project in a single monolithic solution.
It's running on ....
-2
votes
1
answer
226
views
Transaction Management Across Microservices with Rollback Mechanism using Kafka
I am currently developing a microservices architecture consisting of two services, and I'm facing a challenge related to transaction management and error handling.
Microservice A: This service is ...