pokenae.Commons
1.0.22
See the version list below for details.
dotnet add package pokenae.Commons --version 1.0.22
NuGet\Install-Package pokenae.Commons -Version 1.0.22
<PackageReference Include="pokenae.Commons" Version="1.0.22" />
<PackageVersion Include="pokenae.Commons" Version="1.0.22" />
<PackageReference Include="pokenae.Commons" />
paket add pokenae.Commons --version 1.0.22
#r "nuget: pokenae.Commons, 1.0.22"
#addin nuget:?package=pokenae.Commons&version=1.0.22
#tool nuget:?package=pokenae.Commons&version=1.0.22
pokenae.Commons
概要
pokenae.Commons
プロジェクトは、共通のサービス、リポジトリ、エンティティ、DTO、マッピングプロファイル、データベースコンテキスト、フィルタなどを提供します。このプロジェクトは、他のプロジェクトで再利用可能な汎用的な機能を提供することを目的としています。
本プロジェクトはプレゼンテーション層、アプリケーション層、ドメイン層、インフラストラクチャ層の4層で構成されるポケなえのプロジェクトを支援するものです。
各層の責務
プレゼンテーション層
- ユーザーインターフェースを提供し、ユーザーからの入力を受け付けます。
- アプリケーション層のDTOを使用してデータを表示します。
アプリケーション層
- ビジネスロジックを実行し、プレゼンテーション層とドメイン層の間のデータの移動を管理します。
- アプリケーション層のDTOは、アプリケーション層からプレゼンテーション層へのデータの移動を行い、
ApplicationDto
を継承します。
ドメイン層
- ビジネスルールとビジネスロジックを実現します。
- ドメイン層のエンティティは
BaseEntity
を継承します。 - ドメイン層のValueObjectは
BaseValueObject
を継承します。 - ドメイン層のサービスはビジネスルール、ビジネスロジックを実現するためのメインのサービスとリポジトリと1:1で存在するinternalなサブサービスで構成され、サブサービスのインターフェースは
IEntityService
を実装し、その実装はEntityService
を継承します。 - ドメイン層のDTOはインフラストラクチャ層からドメイン層へのデータの移動を行い、
InfrastructureDto
を継承します。 - ドメイン層のリポジトリはDBテーブルなどと1:1で存在し、
IBaseRepository
を実装します。
インフラストラクチャ層
- データベースや外部サービスとの通信を管理します。
- インフラストラクチャ層の
DbContext
はApplicationDbContext
を継承します。 - インフラストラクチャ層のリポジトリの実装は
BaseRepository
を継承します。
マッピング
- 各DTOとエンティティのマッピングを行うmapperは
BaseMappingProfile
を継承します。
フィルタ
pokenae-UserManager(pUM)
を用いた権限管理を行う場合はApiAccessFilter
を有効にします。pUM
を用いてアクセスログ管理を行う場合はLoggingActionFilter
を有効にします。
参照方法
以下の手順に従って、pokenae.Commons
プロジェクトを他のプロジェクトで参照し、利用することができます。
プロジェクト参照の追加:
- Visual Studio 2022で、
pokenae.Commons
プロジェクトを右クリックし、「プロジェクトの依存関係」を選択します。 - 依存関係を追加したいプロジェクトを選択し、「OK」をクリックします。
- Visual Studio 2022で、
NuGetパッケージの復元:
pokenae.Commons
プロジェクトで使用されているNuGetパッケージを復元します。ソリューションエクスプローラーでプロジェクトを右クリックし、「NuGet パッケージの復元」を選択します。
名前空間のインポート:
pokenae.Commons
プロジェクトのクラスやインターフェースを使用するために、必要な名前空間をインポートします。例えば、以下のようにインポートします。using pokenae.Commons.Filters; using pokenae.Commons.Data; using pokenae.Commons.DTOs; using pokenae.Commons.Entities; using pokenae.Commons.Mappings; using pokenae.Commons.Repositories; using pokenae.Commons.Repositories.impl; using pokenae.Commons.Services.Application; using pokenae.Commons.Services.Application.impl;
まとめ
pokenae.Commons
プロジェクトは、共通の機能を提供することで、他のプロジェクトでのコードの再利用性を高め、開発効率を向上させることを目的としています。各クラスやインターフェースを適切に参照し、利用することで、共通のビジネスロジックやデータ操作を簡単に実装することができます。
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. |
-
net8.0
- AutoMapper (>= 14.0.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Mvc (>= 2.3.0)
- Microsoft.AspNetCore.Routing (>= 2.3.0)
- Microsoft.EntityFrameworkCore (>= 8.0.12)
- Microsoft.EntityFrameworkCore.Abstractions (>= 8.0.12)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.12)
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 |
---|---|---|
1.0.27 | 61 | 3/22/2025 |
1.0.26 | 59 | 3/21/2025 |
1.0.25 | 135 | 3/21/2025 |
1.0.24 | 139 | 3/20/2025 |
1.0.23 | 130 | 3/20/2025 |
1.0.22 | 132 | 3/20/2025 |
1.0.21 | 131 | 3/20/2025 |
1.0.20 | 132 | 3/19/2025 |
1.0.19 | 131 | 3/16/2025 |
1.0.18 | 130 | 3/16/2025 |
1.0.17 | 126 | 3/16/2025 |
1.0.16 | 122 | 3/16/2025 |
1.0.15 | 137 | 3/16/2025 |
1.0.14 | 122 | 3/16/2025 |
1.0.13 | 120 | 3/16/2025 |
1.0.12 | 128 | 3/16/2025 |
1.0.11 | 121 | 3/16/2025 |
1.0.10 | 121 | 3/15/2025 |
1.0.9 | 59 | 3/15/2025 |
1.0.8 | 196 | 3/6/2025 |
1.0.7 | 194 | 3/6/2025 |
1.0.6 | 197 | 3/6/2025 |
1.0.5 | 199 | 3/6/2025 |
1.0.4 | 190 | 3/6/2025 |
1.0.3 | 187 | 3/6/2025 |
1.0.2 | 187 | 3/6/2025 |
1.0.1 | 202 | 3/6/2025 |
1.0.0 | 197 | 3/6/2025 |