Muonroi.RuleEngine.Abstractions 1.0.0

dotnet add package Muonroi.RuleEngine.Abstractions --version 1.0.0
                    
NuGet\Install-Package Muonroi.RuleEngine.Abstractions -Version 1.0.0
                    
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="Muonroi.RuleEngine.Abstractions" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Muonroi.RuleEngine.Abstractions" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Muonroi.RuleEngine.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Muonroi.RuleEngine.Abstractions --version 1.0.0
                    
#r "nuget: Muonroi.RuleEngine.Abstractions, 1.0.0"
                    
#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.
#:package Muonroi.RuleEngine.Abstractions@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Muonroi.RuleEngine.Abstractions&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Muonroi.RuleEngine.Abstractions&version=1.0.0
                    
Install as a Cake Tool

Muonroi.BaseTemplate

Ask DeepWiki

This repository provides a .NET solution template designed to accelerate the development of ASP.NET Core applications. It is structured based on Clean/Onion Architecture principles, providing a solid foundation with separate projects for the API, Core (Domain), and Data (Infrastructure) layers.

This template is built on .NET 9.0 and comes pre-configured with a suite of modern tools and patterns to support building robust and scalable web APIs.

Features

  • .NET Solution Template: Easily create new projects using dotnet new.
  • Clean Architecture: A well-organized structure separating concerns into distinct layers:
    • API: Handles presentation logic, controllers, and API endpoints.
    • Core: Contains domain entities, interfaces, and core business logic.
    • Data: Implements data access and other infrastructure concerns.
  • CQRS with MediatR: Implements the Command Query Responsibility Segregation pattern using the MediatR library for clean and decoupled application logic.
  • Authentication & Authorization: Includes a pre-built JWT-based authentication system with endpoints for login and token refresh. It also features a flexible, enum-based permission system (Permission.cs).
  • Entity Framework Core: Configured for data persistence with a DbContext and repository pattern implementation.
  • Structured Logging with Serilog: Integrated Serilog for powerful and configurable logging, with sinks for the console and Elasticsearch.
  • Dependency Injection: Properly configured using built-in .NET DI and supports Autofac.
  • FluentValidation: Includes request validation using FluentValidation.
  • Localization Support: Demonstrates localization for error messages with resource files for English (en-US) and Vietnamese (vi-VN).
  • Centralized Building Blocks: Utilizes the Muonroi.BuildingBlock NuGet package to provide shared components and abstractions.
  • Service Discovery & Messaging: Ready-to-use Consul registration, gRPC server setup and MassTransit message bus integration.
  • Multi-Tenant & Dynamic Permission: Includes tenant context middleware and automatic permission synchronization.

Project Structure

The solution is organized into the following projects:

└── src/
    ├── Muonroi.BaseTemplate.API/   # Presentation Layer (API endpoints, Commands/Queries, DI setup)
    ├── Muonroi.BaseTemplate.Core/  # Domain Layer (Entities, Interfaces, Enums)
    └── Muonroi.BaseTemplate.Data/  # Infrastructure Layer (DbContext, Repositories, Migrations)
  • Muonroi.BaseTemplate.API: Contains the ASP.NET Core Web API project. It hosts the controllers and is the entry point of the application. It depends on the Core and Data layers.
  • Muonroi.BaseTemplate.Core: The core of the application. It contains domain entities (SampleEntity), business logic, and abstractions (interfaces) for repositories and other services. This project has no external dependencies on other layers.
  • Muonroi.BaseTemplate.Data: Implements the interfaces defined in the Core layer. It contains the Entity Framework DbContext, repository implementations, and any other infrastructure-related code like database configurations.

Getting Started

Prerequisites

Installation

To install the template from this repository, clone it and run the following command from the root directory:

dotnet new install ./

Usage

Once the template is installed, you can create a new solution using the following command. The short name for this template is mr-base-sln.

dotnet new mr-base-sln -n YourNewProjectName

This will create a new directory named YourNewProjectName with the complete solution structure.

Customization

The template allows you to specify a base name for classes like DbContext, which replaces BaseTemplate in the generated files. Use the -C or --ClassName parameter:

dotnet new mr-base-sln -n YourNewProjectName -C MyCoreName

This would generate files like MyCoreNameDbContext.cs, MyCoreNameRepository.cs, etc.

Configuration

The application's behavior can be configured through appsettings.Development.json and appsettings.Production.json. Key settings include:

  • DatabaseConfigs: Set the DbType and connection strings.
  • TokenConfigs: Configure JWT issuer, audience, and keys for authentication.
  • Serilog: Configure logging levels and sinks (e.g., Elasticsearch nodes).
  • SecretKey: Provide a secret key used for encrypting sensitive configuration values.
  • MAllowDomains: Configure CORS origins.
  • RedisConfigs: Set up connection details for Redis caching.

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

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

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Muonroi.RuleEngine.Abstractions:

Package Downloads
Muonroi.BuildingBlock

This library provides entities such as `User`, `Role`, `Permission`, and `Language`, and comes with built-in Dependency Injection features, Bearer Token management, JSON handling utilities, string conversion, and localization for multiple languages.

Muonroi.RuleEngine.Core

Package Description

Muonroi.RuleEngine.NRules

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 97 8/17/2025