85,417 questions
Advice
1
vote
3
replies
68
views
Which design pattern should be used for the backend of a web application?
Description: I am building a web app, let's say about an organization for approving participation in a free service. There will be the following roles:
Organization employee
Citizen
Administrator
...
-1
votes
0
answers
33
views
Dapper Mapping not working as expected. Using myql, asp.net core web api [closed]
I am fetching ProductTransfer table together with related products. Although the total records = 1200, am only getting three records returned by my api.
Here is my models
public class ...
1
vote
1
answer
51
views
ASP.NET Core 8 IProblemDetailsWriter fails when using [ProducesResponseType(typeof(T), 201)]
I have an ASP.NET Core Web API controller action that returns a 201 Created response with a custom type, and I also have a custom exception handler that writes ProblemDetails for 400–500 errors.
The ...
1
vote
0
answers
54
views
How to log Headers or Cookies added to outgoing http-request by SocketsHttpHandler
I have a typed HttpClient, added to DI like this:
builder.Services
.AddHttpClient<IExternalApiClient, ExternalApiClient>()
.ConfigurePrimaryHttpMessageHandler(() => ...
Best practices
0
votes
4
replies
69
views
Should I create navigation properties for BaseEntity's CreatedBy/ModifiedBy fields in Entity Framework Core?
I'm building an e-commerce application with ASP.NET Core Web API using Entity Framework Core and ASP.NET Core Identity. I have a BaseEntity class that tracks audit information (who created and last ...
1
vote
1
answer
92
views
Conflict between Microsoft.AspNetCore and System.Security.Cryptography.Pkcs
I'm running into a conflict when trying to include both of the following packages in a project:
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.0" /&...
-1
votes
2
answers
91
views
Angular BASE_URL replacement in Angular 18?
For Angular 6.0-8.0 used with .NET Core 3.1, it was possible to inject the BASE_URL as string in constructor.
What is now the equivalent for the BASE_URL in Angular 18 + .NET 8? How should I approch ...
0
votes
1
answer
99
views
OpenApi 3.1 and AddOpenApi in ASP.NET Core application Int32 vs. String
Well, I'm somewhat stuck here and I don't know which side is doing things it's not supposed to do. I'll try to outline the issue first.
I have an API call which is defined like this:
[HttpGet("...
2
votes
0
answers
56
views
Embedded Views in ASP.NET Core 10
Previously, in .NET 9 and lower, we could use RazorRuntimeCompiliation to implement embedded views in assemblies.
services.Configure<MvcRazorRuntimeCompilationOptions>( options =>
{
var ...
Advice
0
votes
2
replies
52
views
ASP.NET Core 10 integration tests using multiple web projects/entry points
When creating integration tests for ASP.NET Core 10 web apps, we use the WebApplicationFactory<TEntryPoint> class. When a single ASP.NET Core web project is used as SUT, it's simple and it works:...
0
votes
1
answer
35
views
"No operations defined in spec!" when using MMLib.SwaggerForOcelot to build combined swagger for Ocelot
This is my ocelot configuration...
{
"Routes": [
{
"UpstreamPathTemplate": "/api/test/{url}",
"DownstreamPathTemplate": "/api/{url}",...
0
votes
1
answer
47
views
Can't connect a local ASP.NET Core API to my Angular v20 Frontend
I've been fighting this problem for the last 3 weeks. I don't know if I'm also doing something wrong at the moment of connecting the API to the Front end not being able to at least print the JSON ...
3
votes
0
answers
307
views
Upgrading project to .NET 10 breaks Scalar support when using document transformers
I'm currently in the process of upgrading to .NET 10 from .NET 9, but unfortunately as usual the documentation of breaking changes seems to be lacking when it comes to certain functionality and ...
1
vote
0
answers
39
views
I have an ASP.NET Core application that uses Redis as cache but it is recently facing a lot of timeout exceptions
Redis has been recently facing a lot of timeout errors. We are currently using stackExchange.redis or managing Redis in the ASP.NET Core application.
We have used async whenever possible with proper ...
Best practices
0
votes
0
replies
23
views
How to get Autofac Instance Per Request semantics in Asp.Net Core while keeping it idiomatic, i.e. not using tagged matching scopes?
In Asp.Net (not Core) we have InstancePerRequest which uses tagged matching child scopes.
In Asp.Net Core they deprecated InstancePerRequest in favour of InstancePerLifetimeScope which as I understand ...