Set of helpers, extension methods, services and validations (attributes) to help the developers not to reinvent the wheel.
| Project | Build | Documentation | Quality Gate | Coverage |
|---|---|---|---|---|
| KYS.Library | View Docs | |||
| KYS.Library.Excel | View Docs | |||
| KYS.Library.Pdf | View Docs | |||
| KYS.Library.Qr | View Docs | |||
| KYS.Library.Zip | View Docs | |||
| KYS.AspNetCore.Library | View Docs | |||
| KYS.EFCore.Library | View Docs |
| Project | Highlights |
|---|---|
| KYS.Library | DataTable/file/stream/JSON/XML/SQL/URI helpers, translation services, validation attributes, and extension methods |
| KYS.Library.Excel | DataSet/DataTable to Excel export (ExcelHelper, ExcelDataTableHelper), column formatting, row styles, and multi-sheet support with EPPlus |
| KYS.Library.Pdf | HTML-to-PDF conversion, PDF password lock/unlock support, and DataTable-to-PDF rendering with styling via iText |
| KYS.Library.Qr | QR code generation from text/value input, optional logo embedding, and image/data URI output via ZXing + SkiaSharp |
| KYS.Library.Zip | ZIP archive creation/extraction, optional password protection, and file-item packaging through ZipCreator and ZipExtractor |
| KYS.AspNetCore.Library | API response model, security headers middlewares (API / Web), HttpContext extensions, view result helper, JSON-to-HTML tag helper |
| KYS.EFCore.Library | DDD building blocks (Entity, ValueObject, Enumeration, IAggregateRoot), Repository / Unit of Work abstractions, Specification pattern, audit logging, enum description converter |
Most helpers return Result / Result<T> from
CSharpFunctionalExtensions
instead of throwing exceptions. Check IsSuccess / Error, or chain the calls with Bind / Map:
using KYS.Library.Qr;
Result<string> result = QrGenerator.Create("https://example.com")
.Bind(qr => qr.DrawAndToDataUri());
if (result.IsFailure)
logger.LogWarning(result.Error);- SDK: .NET SDK 10.0.200 or newer (projects target .NET 10.0)
- IDE: Visual Studio 2022 17.12 or newer, or VS Code
The library is not yet on NuGet (Future Plan), you can include it in your solution via Project Reference:
- Clone the repository:
git clone https://github.com/yongshun950824/KYS.Library.git - Add the desired project to your solution.
- Reference it in your project file:
<ItemGroup>
<ProjectReference Include="..\KYS.Library\src\KYS.Library\KYS.Library.csproj" />
</ItemGroup>using KYS.Library.Qr;
Result<string> base64 = QrGenerator.Create("https://example.com")
.Bind(qr => qr.DrawAndToBase64());// Requires the EPPlus license to be configured at startup (see Third-party Licenses)
using KYS.Library.Excel;
Result<byte[]> excel = ExcelHelper.CreateExcelBook(dataTable);
if (excel.IsSuccess)
File.WriteAllBytes("report.xlsx", excel.Value);Detailed examples for helpers, extensions, and etc are available in the Documentation.
This repository is MIT licensed, but some dependencies are not:
| Dependency | License | Used by |
|---|---|---|
| EPPlus 6 | PolyForm Noncommercial (a commercial license is required for commercial use) | ExcelHelper, ExcelDataTableHelper.WriteToExcelFile |
| iText 7 | AGPL (commercial license available) | PdfHelper, PdfDataTableHelper.WriteToPdfFile |
EPPlus must be configured by your application before using the Excel helpers. The library does not set it:
// Program.cs
ExcelPackage.LicenseContext = LicenseContext.NonCommercial; // or LicenseContext.CommercialAlternatively, configure it in appsettings.json:
{
"EPPlus": {
"ExcelPackage": {
"LicenseContext": "Commercial"
}
}
}Please review the license terms of these dependencies before using this library in a commercial product.
π¦ KYS.Library β View Full SonarQube Report
| Metric | Badge |
|---|---|
| Quality Gate Status | |
| Coverage | |
| Reliability | |
| Security | |
| Vulnerabilities | |
| Technical Debt | |
| Duplicated Lines | |
| Code Smells | |
| Maintainability |
π¦ KYS.Library.Excel β View Full SonarQube Report
| Metric | Badge |
|---|---|
| Quality Gate Status | |
| Coverage | |
| Reliability | |
| Security | |
| Vulnerabilities | |
| Technical Debt | |
| Duplicated Lines | |
| Code Smells | |
| Maintainability |
π¦ KYS.Library.Pdf β View Full SonarQube Report
| Metric | Badge |
|---|---|
| Quality Gate Status | |
| Coverage | |
| Reliability | |
| Security | |
| Vulnerabilities | |
| Technical Debt | |
| Duplicated Lines | |
| Code Smells | |
| Maintainability |
π¦ KYS.Library.Qr β View Full SonarQube Report
| Metric | Badge |
|---|---|
| Quality Gate Status | |
| Coverage | |
| Reliability | |
| Security | |
| Vulnerabilities | |
| Technical Debt | |
| Duplicated Lines | |
| Code Smells | |
| Maintainability |
π¦ KYS.Library.Zip β View Full SonarQube Report
| Metric | Badge |
|---|---|
| Quality Gate Status | |
| Coverage | |
| Reliability | |
| Security | |
| Vulnerabilities | |
| Technical Debt | |
| Duplicated Lines | |
| Code Smells | |
| Maintainability |
π¦ KYS.AspNetCore.Library β View Full SonarQube Report
| Metric | Badge |
|---|---|
| Quality Gate Status | |
| Coverage | |
| Reliability | |
| Security | |
| Vulnerabilities | |
| Technical Debt | |
| Duplicated Lines | |
| Code Smells | |
| Maintainability |
π¦ KYS.EFCore.Library β View Full SonarQube Report
| Metric | Badge |
|---|---|
| Quality Gate Status | |
| Coverage | |
| Reliability | |
| Security | |
| Vulnerabilities | |
| Technical Debt | |
| Duplicated Lines | |
| Code Smells | |
| Maintainability |
See Releases for version history and breaking changes.
MIT β see Third-party Licenses for dependency terms.