Azunt.ReasonManagement
1.0.3
dotnet add package Azunt.ReasonManagement --version 1.0.3
NuGet\Install-Package Azunt.ReasonManagement -Version 1.0.3
<PackageReference Include="Azunt.ReasonManagement" Version="1.0.3" />
<PackageVersion Include="Azunt.ReasonManagement" Version="1.0.3" />
<PackageReference Include="Azunt.ReasonManagement" />
paket add Azunt.ReasonManagement --version 1.0.3
#r "nuget: Azunt.ReasonManagement, 1.0.3"
#:package Azunt.ReasonManagement@1.0.3
#addin nuget:?package=Azunt.ReasonManagement&version=1.0.3
#tool nuget:?package=Azunt.ReasonManagement&version=1.0.3
Azunt.ReasonManagement
Azunt.ReasonManagement는 Reasons 테이블을 기준으로 이용 사유 이름(Name)과 상세 내용(Content)을 관리하는 재사용 가능한 .NET 모듈입니다.
이 리포지토리는 NuGet 패키지로 게시할 클래스 라이브러리인 Azunt.ReasonManagement와, 해당 패키지를 실제로 테스트할 수 있는 Blazor Server 프로젝트인 Azunt.Web을 함께 포함합니다.
포함 프로젝트
src/Azunt.ReasonManagement
│ Azunt.ReasonManagement.sln
│
├─Azunt.ReasonManagement
│ Azunt.ReasonManagement.csproj
│
├─Azunt.SqlServer
│ Azunt.SqlServer.sqlproj
│
└─Azunt.Web
Azunt.Web.csproj
주요 특징
Reasons테이블에Content NVARCHAR(MAX) NULL컬럼을 포함합니다.Azunt.Web은 EF Core In-Memory DB를 사용하므로 SQL Server 데이터베이스 프로젝트를 게시하지 않아도/Reasons페이지에서 CRUD를 바로 테스트할 수 있습니다.Dul.dll과DulPager를 사용하지 않습니다.ArticleSet과FilterOptions는Azunt.ReasonManagement패키지 내부의 경량 타입을 사용하므로Dul.dll없이 컴파일됩니다.- 페이징 UI는
Azunt.ComponentsNuGet 패키지의Azunt.Components.Paging.Pager컴포넌트를 사용합니다. - 삭제 확인 창은 Azunt.Web 내부 인라인 모달로 구현하여
Del버튼 클릭 후 삭제와 목록 갱신이 바로 동작하도록 구성했습니다. - Excel 다운로드는
EPPlus가 아니라 Microsoft Open XML SDK(DocumentFormat.OpenXml) 기반의ReasonExcelExporter를 사용합니다. - 운영/배포 시에는 EF Core SQL Server, Dapper, ADO.NET 방식도 선택할 수 있습니다.
빠른 실행
Visual Studio에서 다음 솔루션을 엽니다.
src/Azunt.ReasonManagement/Azunt.ReasonManagement.sln
시작 프로젝트를 Azunt.Web으로 설정한 뒤 실행합니다.
실행 후 다음 URL로 이동합니다.
/Reasons
Azunt.Web은 다음 코드로 Reason 모듈을 In-Memory 모드로 등록합니다.
builder.Services.AddDependencyInjectionContainerForReasonApp(
mode: ReasonServicesRegistrationExtensions.RepositoryMode.EfCoreInMemory);
따라서 SQL Server 데이터베이스 프로젝트를 게시하지 않아도 Create, Read, Update, Delete, Search, Sort, Paging, Excel Export를 바로 테스트할 수 있습니다.
NuGet 패키지 생성
클래스 라이브러리 패키지는 다음 명령으로 생성할 수 있습니다.
cd src/Azunt.ReasonManagement
dotnet pack Azunt.ReasonManagement/Azunt.ReasonManagement.csproj -c Release
생성된 .nupkg 파일을 NuGet 서버에 게시한 뒤, 실제 Azunt.Web 프로젝트에서 패키지 참조 방식으로 테스트하면 됩니다.
SQL Server 사용 예
운영 환경에서 SQL Server를 사용하려면 다음처럼 등록합니다.
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDependencyInjectionContainerForReasonApp(
connectionString,
ReasonServicesRegistrationExtensions.RepositoryMode.EfCoreSqlServer);
Dapper 또는 ADO.NET 모드도 같은 연결 문자열을 전달하여 사용할 수 있습니다.
이번 테스트 프로젝트 구성 메모
Azunt.Web.Client프로젝트는 포함하지 않습니다.- Blazor Server의
InteractiveServer렌더링만 사용합니다. - WebAssembly/Webcil 변환 경로에서 발생할 수 있는
tmp-webcil관련 오류를 피하기 위해Microsoft.AspNetCore.Components.WebAssembly.Server참조와AddInteractiveWebAssemblyComponents()설정을 제거했습니다. Azunt.Web은Azunt.ReasonManagement프로젝트를 직접 참조하여 NuGet 게시 전 로컬 테스트가 가능하고, 최종 게시 후에는 Project Reference를 Package Reference로 교체해 테스트할 수 있습니다.
Single Tenant and Multi Tenant Test Pages
The Azunt.Web test project includes two Reason management pages:
/Reasons: single-tenant test page using the default registered repository./ReasonsByTenant: multi-tenant style test page that reads the current tenant connection string fromIUserService.GetUserNotCached().Tenant.ConnectionString.
For local testing, InMemoryUserService returns InMemory:AzuntReasonTenantDb, so the tenant page can run without SQL Server. In a real multi-tenant environment, replace the test IUserService with the application service that resolves the tenant SQL Server connection string from the current user or tenant table.
| 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
- Azunt (>= 1.2.3)
- Dapper (>= 2.1.79)
- DocumentFormat.OpenXml (>= 3.0.2)
- Microsoft.EntityFrameworkCore (>= 8.0.0)
- Microsoft.EntityFrameworkCore.InMemory (>= 8.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 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.