Calabonga.AspNetCore.AppDefinitions 1.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Calabonga.AspNetCore.AppDefinitions --version 1.2.1
NuGet\Install-Package Calabonga.AspNetCore.AppDefinitions -Version 1.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Calabonga.AspNetCore.AppDefinitions" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Calabonga.AspNetCore.AppDefinitions --version 1.2.1
#r "nuget: Calabonga.AspNetCore.AppDefinitions, 1.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Calabonga.AspNetCore.AppDefinitions as a Cake Addin
#addin nuget:?package=Calabonga.AspNetCore.AppDefinitions&version=1.2.1

// Install Calabonga.AspNetCore.AppDefinitions as a Cake Tool
#tool nuget:?package=Calabonga.AspNetCore.AppDefinitions&version=1.2.1

Calabonga.AspNetCore.AppDefinitions

Сборка позволяет навести порядок в вашем Program.cs. Можно всё разложить "по полочкам". Чтобы воспользоваться сборкой надо:

Установка nuget-пакета

Можно воспользоваться инструментов Visual Studio:

image1

Или можно просто прописать в файле проекта, но тогда надо будет подставить правильную версию пакета. Посмотреть последнюю актуальную версию можно на nuget.org.

image2

Создание AppDefinitions

Создайте папку Definitions в вашем проекте. В папке создайте ContainerDefinition и унаследуйте его от AppDefinition, как показано ниже на картинке. После этого сделайте переопределение метода ConfigureServices и/или других методов и свойств.

image3

На этой картинке переопределено два метода:

image4

Подключите ваши определения как показано на этой картинке:

image6

Таких определений (наследников от AppDefinition) может быть сколько угодно (конечно же в разумных пределах). После старта приложения вы увидите (если включен уровень логирования Debug) список всех подключенных определений (AppDefinition). Например, в моём случае их 18.

image5

Фильтрация и порядок

У каждого из созданных вами наследников от AppDefinition есть свойство Enabled и OrderIndex. Угадайте, что можно с ними (с AppDefinitionами) сделать?

An English

Application Definitions base classes. The small but very helpful package that can help you to organize your ASP.NET Core application.

You can find more information in my blog Nimble Framework

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Calabonga.AspNetCore.AppDefinitions:

Repository Stars
Calabonga/Microservice-Template
Templates for microservice architecture. Nimble Microservice Framework contains two modules. The first with OpenIddict and the second without OpenIddict. Templates are built on ASP.NET Core platform with different versions Core3.1, NET6, NET7 and NET8. You can create a new project extremely fast: in Visual Studio, Rider, dotnet CLI.
Version Downloads Last updated
2.4.3 128 4/11/2024
2.4.2 86 4/11/2024
2.4.1 3,693 1/10/2024
2.4.0 1,384 11/22/2023
2.3.0 190 11/6/2023
2.2.0 4,838 8/10/2023
2.1.0 239 8/6/2023
2.0.0 719 6/26/2023
1.3.0 3,297 4/21/2023
1.2.2 1,581 1/19/2023
1.2.1 318 12/30/2022
1.2.0 515 10/3/2022
1.1.0 702 9/19/2022
1.0.0 382 9/4/2022

new pipeline nuget publication implemeneted