• ASP.NET Certifications - Backend for Frontend pattern - Challenges and Pitfalls - Exams of ASP.NET - What is a Modular Monolith?

    The URI space – Modular Monolith

    The modules of this application follow the previously discussed URI space: /{module name}/{module space}. Each module has a Constants file at its root that looks like this: namespace REPR.Baskets;public sealed class Constants{    public const string ModuleName = nameof(Baskets);} We use the ModuleName constant in the {module name}ModuleExtensions files to set the URI prefix and tag the endpoints like this: namespace REPR.Baskets;public static class BasketModuleExtensions{    public static IEndpointRouteBuilder MapBasketModule(this IEndpointRouteBuilder endpoints)    {        _ = endpoints            .MapGroup(Constants.ModuleName.ToLower())            .WithTags(Constants.ModuleName)            .AddFluentValidationFilter()            // Map endpoints            .MapFetchItems()            .MapAddItem()            .MapUpdateQuantity()            .MapRemoveItem()        ;        return endpoints;    }} With this in place, both modules self-register themselves in the correct URI…