https://github.com/ogulcanturan/ogu.extensions.builderorganizer
Organize and manage the registration of multiple builders
https://github.com/ogulcanturan/ogu.extensions.builderorganizer
csharp extensions library netcore
Last synced: 2 months ago
JSON representation
Organize and manage the registration of multiple builders
- Host: GitHub
- URL: https://github.com/ogulcanturan/ogu.extensions.builderorganizer
- Owner: ogulcanturan
- License: apache-2.0
- Created: 2024-05-14T19:49:01.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-04T23:57:29.000Z (10 months ago)
- Last Synced: 2025-03-29T15:47:02.030Z (2 months ago)
- Topics: csharp, extensions, library, netcore
- Language: C#
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
#
Ogu.Extensions.BuilderOrganizer
[](https://github.com/ogulcanturan/Ogu.Extensions.BuilderOrganizer/actions/workflows/dotnet.yml)
[](https://nuget.org/packages/Ogu.Extensions.BuilderOrganizer)
[](https://nuget.org/packages/Ogu.Extensions.BuilderOrganizer)## Introduction
Ogu.Extensions.BuilderOrganizer is a library helps to organize and manage the registration of multiple builders.
## Features
- Organize builders in a specific order for object construction.
- Support for sorting builders in ascending or descending order.## Installation
You can install the library via NuGet Package Manager:
```bash
dotnet add package Ogu.Extensions.BuilderOrganizer
```## Usage
```csharp
public static BuilderOrganizer Applications { get; internal set; } = new BuilderOrganizer(ascending: false);public void ConfigureServices(IServiceCollection services)
{
Applications.Add(4, app => app.UseRouting(), "UseRouting");
Applications.Add(0.9, app => app.UseAuthentication(), "UseAuthentication");
Applications.Add(0.8, app => app.UseAuthorization(), "UseAuthorization");
Applications.Add(0.7, app => app.UseEndpoints(endpoints => endpoints.MapControllers()), "UseEndpoints");
}public void Configure(IApplicationBuilder app)
{
Applications.Build(app);
}
```