FortiCore 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FortiCore --version 1.0.0
                    
NuGet\Install-Package FortiCore -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="FortiCore" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FortiCore" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="FortiCore" />
                    
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 FortiCore --version 1.0.0
                    
#r "nuget: FortiCore, 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 FortiCore@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=FortiCore&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=FortiCore&version=1.0.0
                    
Install as a Cake Tool

FortiCore Library

FortiCore is a .NET library that provides core functionality for building robust web applications with features like logging, validation, and exception handling. This solution includes both the core library and a test API project.

🚀 Features

Core Library Features

  • MediatR Integration - Built-in CQRS pattern support
  • Logging System
    • Elasticsearch integration
    • Request/Response logging
    • Exception logging
    • Reference ID tracking
  • Validation Framework - FluentValidation integration
  • Exception Handling - Centralized error management
  • Response Standardization - Consistent API responses

🛠 Technology Stack

  • .NET 8.0
  • MediatR 12.4.1
  • FluentValidation
  • Elasticsearch
  • NEST 7.17.5
  • Serilog 4.0
  • Docker & Docker Compose

📦 Installation

  1. Clone the repository
  2. Build the solution:
dotnet build
  1. Run the Elasticsearch and Kibana containers:
docker-compose up -d

🔧 Configuration

Elasticsearch Setup

The default configuration connects to:

  • Elasticsearch: http://localhost:9200
  • Kibana: http://localhost:5601

Logging Configuration

Logs are automatically sent to Elasticsearch with the following information:

  • Timestamp
  • Log Level
  • Method Information
  • Request/Response Data
  • Execution Time
  • Reference ID

💡 Usage Examples

Adding FortiCore to Your Project

builder.Services.AddCustomLogging(typeof(Program).Assembly);

Creating a Query Handler

public class UserInformationQueryHandler : IRequestHandler<UserInformationQuery, UserInformationQueryResult>
{
    public async Task<UserInformationQueryResult> Handle(UserInformationQuery request, 
        CancellationToken cancellationToken)
    {
        return new UserInformationQueryResult() { Users = list }.ToSuccessResult();
    }
}

🔐 License

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

👥 Contributors

  • Cuneyt Serdaroglu

📫 Support

For support, please open an issue in the repository.

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.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 286 3/23/2025
1.0.1 161 3/19/2025
1.0.0 177 3/9/2025