Vhat.Infrastructure
10.27.440
dotnet add package Vhat.Infrastructure --version 10.27.440
NuGet\Install-Package Vhat.Infrastructure -Version 10.27.440
<PackageReference Include="Vhat.Infrastructure" Version="10.27.440" />
<PackageVersion Include="Vhat.Infrastructure" Version="10.27.440" />
<PackageReference Include="Vhat.Infrastructure" />
paket add Vhat.Infrastructure --version 10.27.440
#r "nuget: Vhat.Infrastructure, 10.27.440"
#:package Vhat.Infrastructure@10.27.440
#addin nuget:?package=Vhat.Infrastructure&version=10.27.440
#tool nuget:?package=Vhat.Infrastructure&version=10.27.440
Core Library - Vhat System
<div align="center">
Bộ thư viện tập trung các thành phần dùng chung cho các dịch vụ .NET
Tính năng • Cài đặt • Sử dụng • Tài liệu • Đóng góp
</div>
📋 Giới thiệu
Core Library là bộ thư viện nền tảng của Viet Hung Automation Technology, cung cấp các thành phần và utilities dùng chung cho các dịch vụ .NET. Dự án được xây dựng trên .NET 10.0 với kiến trúc 2-layer (Core + Infrastructure) và tích hợp đầy đủ CI/CD pipeline thông qua GitHub Actions.
✨ Tính năng
Core Components
- Caching: Multi-layer caching với Redis và Memory cache, hỗ trợ tag-based invalidation
- Data Access: Bulk operations, connection pooling, retry policies với Polly
- Message Queue: RabbitMQ integration với reliable messaging patterns
- Object Storage: MinIO/S3 compatible storage service
- Search: Elasticsearch integration cho full-text search
- Security: RSA encryption, JWT handling, secure utilities
- Monitoring: InfluxDB integration, health checks, performance metrics
- Logging: Structured logging với Serilog
Architecture
- 2-Layer Design:
Vhat.Core(abstractions) +Vhat.Infrastructure(implementations) - Dependency Injection: Primary constructor pattern
- Async/Await: Toàn bộ I/O operations sử dụng async
- Entity Pattern: BaseEntity với ULID (26 chars, sortable)
- Interface-First: Mọi service đều có interface tương ứng
🚀 Trạng thái dự án
| Workflow | Mô tả | Trigger |
|---|---|---|
| Publish Package | Tự động đóng gói và publish lên NuGet | Push vào nhánh release |
| Code Analysis | Phân tích chất lượng mã nguồn | Push vào nhánh analysis, hàng tuần |
| Build & Test | Biên dịch và chạy unit tests | Mọi push và pull request |
| Dependabot | Cập nhật dependencies | Hàng tuần |
📁 Cấu trúc dự án
core-lib/
├── src/
│ ├── Vhat.Core/ # Core abstractions & entities
│ │ ├── Entities/ # BaseEntity, domain models
│ │ ├── Interfaces/ # Service interfaces
│ │ └── Extensions.cs # Core extension methods
│ └── Vhat.Infrastructure/ # Concrete implementations
│ ├── Caching/ # Redis & Memory cache
│ ├── Data/ # Data access layer
│ ├── MessageQueue/ # RabbitMQ services
│ ├── ObjectStore/ # MinIO storage
│ ├── Search/ # Elasticsearch
│ ├── Security/ # Encryption & auth
│ └── Monitoring/ # Metrics & health checks
├── tests/
│ ├── Vhat.UnitTests/ # Unit tests (xUnit)
│ └── Vhat.Benchmarks/ # Performance benchmarks
└── tools/
└── Vhat.Tool/ # CLI development tools
📦 Cài đặt
NuGet Packages
# Core package (entities, interfaces, utilities)
dotnet add package Vhat.Core
# Infrastructure package (implementations)
dotnet add package Vhat.Infrastructure
Yêu cầu hệ thống
- .NET 10.0 SDK trở lên
- Visual Studio 2022 hoặc VS Code với C# extension
- Docker (tùy chọn - cho Redis, MongoDB, SQL Server local)
💻 Sử dụng nhanh
1. Cấu hình Dependency Injection
// Program.cs
var builder = WebApplication.CreateBuilder(args);
// Đăng ký services
builder.Services.AddVhatCore();
builder.Services.AddVhatInfrastructure(builder.Configuration);
var app = builder.Build();
2. Sử dụng Caching Service
public class MyService(IHybridRedisCacheService cache)
{
public async Task<User> GetUserAsync(string userId)
{
var cacheKey = $"user:{userId}";
return await cache.GetOrSetAsync(
cacheKey,
async () => await _repository.GetUserAsync(userId),
TimeSpan.FromMinutes(30)
);
}
}
3. Sử dụng Data Access
public class UserRepository(ICoreData coreData)
{
public async Task<IEnumerable<User>> GetAllAsync()
{
return await coreData.SelectAsync<User>(
"SELECT * FROM Users WHERE IsActive = @IsActive",
new { IsActive = true }
);
}
public async Task BulkInsertAsync(IEnumerable<User> users)
{
await coreData.BulkInsertAsync(users);
}
}
Xem thêm ví dụ chi tiết trong API.md.
📚 Tài liệu
| Tài liệu | Mô tả |
|---|---|
| CHANGELOG.md | Lịch sử thay đổi theo phiên bản |
| CONTRIBUTING.md | Quy tắc đóng góp và coding conventions |
| SECURITY.md | Chính sách bảo mật |
| CODE_OF_CONDUCT.md | Quy tắc ứng xử cộng đồng |
🤝 Đóng góp
Chúng tôi chào đón mọi đóng góp! Vui lòng đọc CONTRIBUTING.md để biết:
- Quy trình phát triển và pull request
- Coding conventions và best practices
- Branching strategy
- Testing requirements
Để báo cáo lỗi hoặc đề xuất tính năng, xem ISSUES.md.
🔐 Bảo mật
Nếu phát hiện lỗ hổng bảo mật, KHÔNG tạo public issue. Vui lòng liên hệ trực tiếp:
- Email: phivanloi@outlook.com
- Điện thoại: 0588953888
Xem thêm chi tiết trong SECURITY.md.
📄 Giấy phép
Copyright © 2020-2025 Viet Hung Automation Technology. All rights reserved.
Dự án này sử dụng giấy phép độc quyền (proprietary). Mã nguồn chỉ được sử dụng cho mục đích nội bộ và các bên được cấp phép. Xem LICENSE để biết thêm chi tiết.
📞 Liên hệ
- Tổ chức: Viet Hung Automation Technology
- Người phụ trách: Phí Văn Lời
- Email: phivanloi@outlook.com
- Phone: 0588953888
- Repository: github.com/vhatsystem/core-lib
<div align="center"> Made with ❤️ by Viet Hung Automation Technology </div>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Dapper (>= 2.1.66)
- FirebaseAdmin (>= 3.4.0)
- InfluxDB.Client (>= 4.18.0)
- MeiliSearch (>= 0.18.0)
- Microsoft.Data.SqlClient (>= 6.1.3)
- Microsoft.EntityFrameworkCore (>= 10.0.1)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.1)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.1)
- Microsoft.Extensions.Caching.Hybrid (>= 10.1.0)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 10.0.1)
- Microsoft.Extensions.Http.Polly (>= 10.0.1)
- Microsoft.Extensions.Http.Resilience (>= 10.1.0)
- Minio (>= 7.0.0)
- MongoDB.Driver (>= 3.5.2)
- OpenAI (>= 2.8.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.14.0)
- OpenTelemetry.Extensions.Hosting (>= 1.14.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.14.0)
- OpenTelemetry.Instrumentation.Http (>= 1.14.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.14.0)
- Polly (>= 8.6.5)
- RabbitMQ.Client (>= 7.2.0)
- Telegram.Bot (>= 22.8.1)
- Vhat.Core (>= 10.27.440)
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 |
|---|---|---|
| 10.27.440 | 0 | 1/9/2026 |
| 10.27.439 | 247 | 1/4/2026 |
| 10.27.438 | 89 | 1/3/2026 |
| 10.27.437 | 85 | 1/2/2026 |
| 10.26.437 | 83 | 1/2/2026 |
| 10.26.436 | 206 | 12/28/2025 |
| 10.26.435 | 116 | 12/27/2025 |
| 10.26.434 | 92 | 12/26/2025 |
| 10.26.433 | 158 | 12/26/2025 |
| 10.26.432 | 475 | 12/18/2025 |
| 10.26.431 | 282 | 12/17/2025 |
| 10.26.430 | 264 | 12/17/2025 |
| 10.26.429 | 262 | 12/17/2025 |
| 10.26.428 | 261 | 12/17/2025 |
| 10.26.427 | 260 | 12/17/2025 |
| 10.26.426 | 681 | 12/10/2025 |
| 10.26.425 | 345 | 12/8/2025 |
| 10.26.424 | 338 | 12/8/2025 |
| 10.26.423 | 131 | 12/6/2025 |
| 10.26.422 | 659 | 12/3/2025 |
| 10.26.421 | 252 | 11/30/2025 |
| 10.26.420 | 120 | 11/29/2025 |
| 10.26.419 | 197 | 11/24/2025 |
| 10.26.418 | 128 | 11/23/2025 |
| 10.26.417 | 292 | 11/16/2025 |
| 10.26.416 | 286 | 11/12/2025 |
| 9.25.415 | 219 | 10/31/2025 |
| 9.25.414 | 203 | 10/29/2025 |
| 9.25.413 | 246 | 10/21/2025 |
| 9.25.412 | 175 | 10/19/2025 |
| 9.25.411 | 235 | 10/12/2025 |
| 9.25.410 | 178 | 10/10/2025 |
| 9.25.409 | 150 | 10/10/2025 |
| 9.25.408 | 283 | 10/2/2025 |
| 9.25.407 | 248 | 9/30/2025 |
| 9.25.406 | 169 | 9/30/2025 |
| 9.25.405 | 169 | 9/29/2025 |
| 9.25.404 | 171 | 9/29/2025 |
| 9.25.403 | 117 | 9/27/2025 |
| 9.25.402 | 151 | 9/26/2025 |
| 9.25.401 | 186 | 9/23/2025 |
| 9.25.400 | 177 | 9/22/2025 |
| 9.25.399 | 268 | 9/19/2025 |
| 9.24.398 | 271 | 9/19/2025 |
| 9.24.397 | 126 | 9/13/2025 |
| 9.24.396 | 220 | 9/11/2025 |
| 9.24.395 | 183 | 9/9/2025 |