Tasken.Core
1.1.4
dotnet add package Tasken.Core --version 1.1.4
NuGet\Install-Package Tasken.Core -Version 1.1.4
<PackageReference Include="Tasken.Core" Version="1.1.4" />
<PackageVersion Include="Tasken.Core" Version="1.1.4" />
<PackageReference Include="Tasken.Core" />
paket add Tasken.Core --version 1.1.4
#r "nuget: Tasken.Core, 1.1.4"
#:package Tasken.Core@1.1.4
#addin nuget:?package=Tasken.Core&version=1.1.4
#tool nuget:?package=Tasken.Core&version=1.1.4
Tasken Platform
Repository này chứa các thành phần nền tảng chính của hệ thống Tasken trên .NET 8.
Hiện tại solution được tổ chức quanh hai project cốt lõi:
Tasken.Api: public API host, gateway, reverse proxy, swagger, health checks, metricsTasken.Core: shared business platform package dùng chung cho các host và module services
Phiên bản package hiện tại của Tasken.Core là 1.1.4.
Navigation
- Overview
- Current Architecture
- Projects
- Repository Structure
- Tasken.Core Package
- Build And Test
- Pack And Publish
- Using Tasken.Core In Other Projects
- Additional Documentation
Overview
Mục tiêu của repository này:
- chuẩn hóa business platform dùng chung cho hệ sinh thái Tasken
- cung cấp một public API host thống nhất cho external traffic
- hỗ trợ mô hình module service đứng sau gateway
- giữ dependency direction rõ ràng giữa host layer và core business layer
Current Architecture
Kiến trúc hiện tại theo mô hình:
Tasken.Apilà public entry pointTasken.Corelà shared business package- các module nghiệp vụ như
Tasken.Accountantcó thể chạy độc lập phía sau gateway
flowchart LR
Client["Client"] --> Api["Tasken.Api"]
Api --> Common["Common controllers"]
Api --> Proxy["YARP reverse proxy"]
Common --> Core["Tasken.Core"]
Proxy --> Module["Tasken.Accountant / other modules"]
Module --> Core
Tài liệu chi tiết hơn có tại docs/System-Architecture.md.
Projects
Tasken.Api
Vai trò:
- ASP.NET Core public host
- gateway và reverse proxy qua YARP
- common API endpoints
- Swagger/OpenAPI exposure
- health checks và Prometheus metrics
Tài liệu riêng: Tasken.Api/README.md
Tasken.Core
Vai trò:
- entities
- repositories
- services
- persistence
- shared infrastructure primitives
- email abstractions và implementations
Đây là package dùng lại giữa các host và module services.
Tasken.Core.Tests
Chứa unit tests cho repository layer và các thành phần nền cần kiểm thử tự động.
Repository Structure
Tasken.Core/
README.md
Tasken.Core.sln
compose.yaml
docs/
Tasken.Api/
Tasken.Core/
Tasken.Core.Tests/
Tasken.Core Package
Metadata chính của package:
PackageId:Tasken.CoreVersion:1.1.4TargetFramework:net8.0Company:Opus Solution Company
Project file: Tasken.Core.csproj
Capabilities
Tasken.Core hiện cung cấp:
- shared entities
- EF Core persistence
- repository abstractions và implementations
- service registration extensions
- email abstractions, options, validators, và implementations
- shared constants và helper infrastructure
Install From NuGet
dotnet add package Tasken.Core --version 1.1.4
dotnet restore
Install From GitHub Packages
Thêm source:
dotnet nuget add source "https://nuget.pkg.github.com/Opus-Solution/index.json" \
--name "github-opus-tasken" \
--username "<github-username>" \
--password "<github-token>" \
--store-password-in-clear-text
Cài package:
dotnet add package Tasken.Core --version 1.1.4 --source "github-opus-tasken" --source "https://api.nuget.org/v3/index.json"
dotnet restore
Build And Test
Build entire solution
dotnet build Tasken.Core.sln
Run tests
dotnet test Tasken.Core.sln
Build individual projects
dotnet build Tasken.Api/Tasken.Api.csproj
dotnet build Tasken.Core/Tasken.Core.csproj
Pack And Publish
Pack Tasken.Core
dotnet pack Tasken.Core/Tasken.Core.csproj -c Release
Package output dự kiến:
Tasken.Core/bin/Release/Tasken.Core.1.1.4.nupkgTasken.Core/bin/Release/Tasken.Core.1.1.4.snupkg
Nếu GeneratePackageOnBuild đang bật trong project file, package cũng có thể được sinh trong quá trình build phù hợp.
Using Tasken.Core In Other Projects
Ví dụ đăng ký persistence, repositories, và services:
using Tasken.Core.Persistence.Extensions;
using Tasken.Core.Repositories.Extensions;
using Tasken.Core.Services.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTaskenSqlServerPersistence(builder.Configuration);
builder.Services.AddTaskenRepositories();
builder.Services.AddTaskenServices();
Ví dụ dùng email services:
using Tasken.Core.Email.Abstractions;
using Tasken.Core.Email.Models;
public sealed class NotificationService
{
private readonly IEmailService _emailService;
public NotificationService(IEmailService emailService)
{
_emailService = emailService;
}
public async Task SendAsync()
{
await _emailService.SendAsync(new EmailMessage
{
Subject = "Hello from Tasken.Core",
Body = "<b>Notification</b>",
IsHtml = true,
To = new List<string> { "user@company.com" }
});
}
}
Additional Documentation
| Product | Versions 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. |
-
net8.0
- Azure.Identity (>= 1.12.0)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 8.0.0)
- Microsoft.Data.SqlClient (>= 5.2.2)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
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 |
|---|