Bonyan 1.0.9-pre1

This is a prerelease version of Bonyan.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Bonyan --version 1.0.9-pre1                
NuGet\Install-Package Bonyan -Version 1.0.9-pre1                
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="Bonyan" Version="1.0.9-pre1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bonyan --version 1.0.9-pre1                
#r "nuget: Bonyan, 1.0.9-pre1"                
#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 Bonyan as a Cake Addin
#addin nuget:?package=Bonyan&version=1.0.9-pre1&prerelease

// Install Bonyan as a Cake Tool
#tool nuget:?package=Bonyan&version=1.0.9-pre1&prerelease                

Bonyan Library Overview and Project Blueprint

Welcome to the Bonyan Library! This guide will help you understand the core structure and clean architecture approach of Bonyan, an encapsulated .NET Core solution that emphasizes maintainability and modularity while not relying too heavily on all .NET Core features. The focus is on Clean Architecture principles to ensure separation of concerns and a highly maintainable codebase.

Installation Methods

You can install the Bonyan packages using any of the following methods:

1. .NET CLI

Use the .NET Command Line Interface to add the Bonyan.AspNetCore package to your project:

dotnet add package Bonyan.AspNetCore

2. Package Manager Console (Visual Studio)

Alternatively, you can use the Package Manager Console available in Visual Studio:

Install-Package Bonyan.AspNetCore

3. PackageReference

Another option is to manually add the package reference in your project .csproj file:

<ItemGroup>
  <PackageReference Include="Bonyan.AspNetCore" Version="latest" />
</ItemGroup>

Make sure to replace latest with the version of the package you want to use.

Using Bonyan in Your Project

Once the Bonyan package is installed, you can configure it in your project by setting up an application builder. Here's a sample code snippet to get you started:

var builder = WebApplication
    .CreateApplicationBuilder<BonyanTemplateModule>(args);

var app = builder.Build();

app.Run();

This will create and configure a basic Bonyan application.

Module Structure and Clean Architecture Blueprint

In Bonyan, each module should inherit from Module (or WebModule for web-related modules). A module encapsulates a specific part of the application, promoting modularity and separation of concerns in line with Clean Architecture principles. This approach limits the direct use of the .NET Core features in favor of focusing on a more abstract and flexible design.

High-Level Structure

The Bonyan library is built on a modular architecture that promotes:

  • Encapsulation: Each module has well-defined responsibilities and hides implementation details.
  • Separation of Concerns: Different application layers are clearly separated to facilitate easier testing and maintainability.
  • Dependency Management: Modules define their dependencies explicitly using attributes like DependOnAttribute to ensure proper initialization order.

Example Module

Below is a basic example of how you can create a module:

namespace BonyanTemplate.Api
{
    public class BonyanTemplateModule : Module
    {
        public override Task OnConfigureAsync(ModularityContext context)
        {
            // Custom configuration code here
            return base.OnConfigureAsync(context);
        }

        public override Task OnInitializeAsync(ModularityInitializedContext context)
        {
            // Custom initialization code here
            return base.OnInitializeAsync(context);
        }
    }
}

In this setup, each module encapsulates its behavior, ensuring that the logic is self-contained and follows the Clean Architecture principles.

Specifying Dependencies with DependOnAttribute

Bonyan allows you to define module dependencies using the DependOnAttribute. This attribute helps in managing dependencies between various modules, ensuring that dependent modules are loaded in the correct order. This approach aligns with Clean Architecture's focus on managing dependencies to keep the application flexible and testable.

Here’s how you can specify a dependency between modules:

using Bonyan.Modularity;

namespace BonyanTemplate.Api
{
    [DependOn(typeof(AnotherModule))]
    public class BonyanTemplateModule : Module
    {
        public override Task OnConfigureAsync(ModularityContext context)
        {
            // Module configuration code
            return base.OnConfigureAsync(context);
        }
    }
}

In this example, BonyanTemplateModule depends on AnotherModule, meaning AnotherModule will be initialized before BonyanTemplateModule. This is particularly useful for managing complex applications that contain multiple interdependent modules.

Summary

  • Install Bonyan.AspNetCore using CLI, Visual Studio, or by adding it to your .csproj file.
  • Create a custom module by inheriting from Module or WebModule.
  • Use DependOnAttribute to manage dependencies between your modules and adhere to Clean Architecture principles.

For more detailed information, please refer to the official documentation or contact the maintainers of the Bonyan library. We hope this guide helps you get started with Bonyan!

Example Console Output

Here is an example of what the console output might look like when modules with dependencies are created:

- BonyanTemplateModule created
  - BonyanFastEndpointSecurityModule created
    - BonyanFastEndpointModule created
      - BonyanAspNetCoreModule created

This output shows the order in which the modules are initialized, respecting their dependencies, and emphasizes the Clean Architecture approach to modularity.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (20)

Showing the top 5 NuGet packages that depend on Bonyan:

Package Downloads
Bonyan.Security

Package Description

Bonyan.MultiTenant

Package Description

Bonyan.AspNetCore

Package Description

Bonyan.UnitOfWork

Package Description

Bonyan.Validation

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.11 331 12/12/2024
1.2.10 334 12/12/2024
1.2.9 341 12/12/2024
1.2.8 337 12/12/2024
1.2.7 326 12/11/2024
1.2.6 330 12/11/2024
1.2.4 350 12/5/2024
1.2.3 358 12/5/2024
1.2.2 373 12/5/2024
1.2.1 386 11/19/2024
1.2.0 302 11/17/2024
1.2.0-pre3 278 11/16/2024
1.2.0-pre2 191 11/16/2024
1.2.0-pre1 291 11/16/2024
1.1.9 337 11/14/2024
1.1.8 307 11/14/2024
1.1.7 286 11/14/2024
1.1.6 281 11/14/2024
1.1.6-pre3 283 11/9/2024
1.1.6-pre2 249 11/7/2024
1.1.6-pre1 237 11/7/2024
1.1.5 244 11/6/2024
1.1.4 259 11/6/2024
1.1.3 261 11/5/2024
1.1.2-pre7 236 11/2/2024
1.1.2-pre6 242 11/2/2024
1.1.2-pre5 232 11/2/2024
1.1.2-pre4 222 11/2/2024
1.1.2-pre3 241 11/2/2024
1.1.2-pre2 229 11/2/2024
1.1.2-pre1 230 11/1/2024
1.1.1 264 10/30/2024
1.1.0 221 10/28/2024
1.0.9 253 10/28/2024
1.0.9-pre4 187 10/28/2024
1.0.9-pre3 188 10/28/2024
1.0.9-pre2 183 10/28/2024
1.0.9-pre1 157 10/27/2024
1.0.8 180 10/27/2024
1.0.7 164 10/24/2024
1.0.6-dev1 155 9/12/2024
1.0.5 163 9/12/2024
1.0.5-pre7 149 9/12/2024
1.0.5-pre6 156 9/11/2024
1.0.5-pre5 147 9/10/2024
1.0.5-pre4 150 9/10/2024
1.0.5-pre3 150 9/10/2024
1.0.5-pre2 150 9/10/2024
1.0.5-pre1 158 9/9/2024
1.0.4 179 9/9/2024
1.0.3 178 9/9/2024
1.0.2 151 9/8/2024
1.0.2-pre1 106 9/8/2024
1.0.1 136 9/8/2024
1.0.0 133 9/8/2024