Skip to content

ElderMaxonNET/SadLib

Repository files navigation

SadLib

A lightweight, high-performance .NET infrastructure framework designed to eliminate boilerplate code. SadLib provides clean abstractions for object mapping, database operations, file upload and management.

🚀 Key Features

  • Contract-Based Mapping: Fast object-to-object mapping using marker interfaces.
  • Managed Data Access: Simplified Dapper-friendly IDbClient with automatic connection and transaction management.
  • Flexible Storage: Abstraction for local or cloud file storage.
  • Secure Uploads: Integrated file type validation and image processing pipeline.
  • Pagination: Standardized IPagedResult for consistent API responses.

📦 Installation

dotnet add package SadLib

🛠️ Quick Start

To enable SadLib features, register the services in your Program.cs (or Startup.cs) using the fluent configuration API:

using SadLib.Infrastructure.DependencyInjection;
using SadLib.Infrastructure.Storage.Providers;

var builder = WebApplication.CreateBuilder(args);

// Add SadLib Services
builder.Services.AddSadLib(options =>
{
    options
    .UseMapper(System.Reflection.Assembly.GetExecutingAssembly(), $"{nameof(YourProjectName)}.Models")
    .UseStorage(new PhysicalStorageProviderFactory(builder.Environment.WebRootPath))
    .UseDbService(Microsoft.Data.SqlClient.SqlClientFactory.Instance)
    .UseUpload();
});

var app = builder.Build();

🌟 Live Demo & Example Project

To see SadLib in action within a real-world scenario, check out our comprehensive demo application. It demonstrates full-stack integration, including RBAC, advanced file management, and repository patterns.

👉 AspNetCoreMvcDemoApp - Full Showcase

About

A lightweight, high-performance C# infrastructure framework featuring contract-based mapping, managed database operations, and extensible storage/upload services for .NET applications.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages