Skip to content

Conversation

@TobiasAhnoff
Copy link
Collaborator

Update to .Net10 and remove external dependencies (Moq and Automapper) that can be replaced with .NET code.

TobiasAhnoff and others added 7 commits November 12, 2025 14:56
* Clarify code by naming updates and use C#

This patch updates a few names in the code to make the code more
readable.  It also refactors some code to use more modern C#
features, like collection initializers etc.

* Clarify Product type properties

This patch updates the Product types to clarify nullability and
mutability.  All properties are marked required and immutable.

* Replace classic app insights SDK with OTel

This patch replace the now classic SDK for Application Insights
with the recommended open telemetry distro.

* Clarify issuer validation

This patch adds ValidIssuers node to the appsettings configuration
to clarify this important setting and be explicit about it's value.

* Replace MVC controllers with minimal apis

This patch replace the MVC Controllers with Minimal API endpoints
instead.  This is now the recommended approach for building APIs
in ASP.NET

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/apis?view=aspnetcore-10.0&preserve-view=true#minimal-apis---recommended-for-new-projects
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/apis?view=aspnetcore-10.0&preserve-view=true#choosing-between-approaches

* Introduce mapping class

This patch adds a mapping class in the two complete projects.  A
separate mapper class can be a strong pattern as the domain grows.  It
clarifies the relationship between the domain types and the rest.  As
classes grow larger, a mapping library like Mapperly can be very
useful.

* Replace tuple service return with result pattern

This patch adds a ServiceResult record that encapsulates the service
result.  This can be a powerful pattern to clarify error handling
in domain logic and centralize mapping domain errors to endpoint
result codes.

The downside is that important logic is perhaps hidden behind an
abstraction.

* Fix broken unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants