All Questions
Tagged with .net-core asp.net-core
27
questions
4
votes
2
answers
522
views
Is the entire web request the right scope for a DbContext in EF Core?
The usual advice for using EF Core in a web application is to use a scoped DbContext per HTTP request. This is even the suggested default for web application in the Microsoft documentation. I recently ...
-1
votes
3
answers
149
views
Possible Solutions for avoiding applications sharing database
Background:
I work on a small group (5-10) of lightly used .Net web applications.
The applications typically have dedicated databases, but there are instances of an application accessing another ...
0
votes
1
answer
118
views
Where to put the reference to Application Insights in an application designed with the Clean Architecture template?
We are implementing an application by trying to follow the Clean Architecture template for C#.
Our application is an ASP.NET core web api and we want to implement the observability for that ...
5
votes
3
answers
2k
views
In .net 6 dependency injection and Program.cs, what is the best practice for handling a large number of dependencies?
I've seen a ton of examples of how to do DI, and the example always shows two dependencies. But what about when you have 50 or 100 dependencies (or more) in a large-ish application? The Program.cs ...
1
vote
0
answers
264
views
Microservice code reuse strategy for static classes
Hope this is the right place to post an opinion-based question like this. I'm in the process of converting an aging API monolith to a set of .NET 5/C#-based microservices and working on the code reuse ...
5
votes
4
answers
550
views
How to create a modular system of multiple .NET Core applications extending a single application?
So first of all let me explain what I want to achieve:
I want to create a basic .NET Core console application which is responsible for loading external extensions (more on this later on), listening ...
1
vote
4
answers
2k
views
Should you validate route parameters or let them fail with a 404?
So this is an example endpoint to fetch one user by its username
[HttpGet("{username}")]
public async Task<ActionResult<object>> GetUser([FromRoute] string username)
{
// ...
...
1
vote
1
answer
419
views
keep Controllers at one place or organize by domain
When creating a new .NET Core Web API the controllers will be put in the Controllers directory. I want to create request models for incoming requests (for validation purposes) and response models ...
2
votes
3
answers
499
views
How to clone an object graph and keep relationships of objects intact?
In my ASP.net core application with Angular 2+ client, I work with a complicated object graph. In the object graph I have some objects with references to each other. I have a simplification included ...
0
votes
1
answer
614
views
What's a good liveness probe for a Hangfire background job server?
We're in the process of moving everything to K8s and one of our applications is a small .NET Core 2.2 console app that runs a Hangfire background job server. At the moment the app runs as a Windows ...
1
vote
2
answers
780
views
Is there still a place for non-async methods in Data Repository?
If we start a .NET Core 3.0 project today, which will use database connection (for example ASP.NET Core Web API), is there still a place for non-async operations while talking to the database?
Or in ...
0
votes
0
answers
355
views
Registering dependency implemented in separate assembly with shared interfaces
Situation:
I have a project with a Business Layer (WizBang.BL) that contains nearly all of my application logic. It communicates with a Data Layer (WizBang.Data) that contains by entity classes and ...
1
vote
1
answer
2k
views
Domain Driven Design: Should Specification Pattern exist in Repository or Application level for Paging?
In Domain Driven Design, should the specification pattern for paging/pagination exist on the Repository level or Application level, or another layer? Trying to see what Eric Evans author of DDD stated....
-3
votes
3
answers
1k
views
Hosting a standalone .Net Core Web Application
We've created a .Net Core Web Application and are deploying it as a stand-alone exe. The main reason for deploying it stand-alone was to not be dependent upon the version of .Net Core installed on the ...
5
votes
2
answers
3k
views
C# extension methods design patterns and usage guidelines?
C# extension methods have seen a rise in usage over recent years. The offical microsoft guidelines on usage state: "In general, we recommend that you implement extension methods sparingly and only ...