using Microsoft.AspNetCore.Builder; namespace Prefab.Module; /// /// Defines a contract for modular components that can register services and configure the application pipeline within a /// web application. /// /// Implement this interface to encapsulate the registration of services and middleware required by a /// module. This enables modular composition of application features and promotes separation of concerns. public interface IModule { /// /// Configures and returns the specified web application builder. /// /// The WebApplicationBuilder instance to configure. Cannot be null. /// The configured WebApplicationBuilder instance. WebApplicationBuilder Build(WebApplicationBuilder builder); /// /// Configures the specified web application by adding middleware, services, or other components required for /// application startup. /// /// Call this method during application startup to apply custom configuration to the web /// application pipeline. This method is commonly used to register middleware, endpoints, or other application /// features before the application is run. /// The instance to configure. Must not be null. /// The configured instance. This is typically the same instance as the input /// parameter, with additional configuration applied. WebApplication Configure(WebApplication app); }