ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions 10.0.0-beta.1

This is a prerelease version of ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions.
dotnet add package ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions --version 10.0.0-beta.1
                    
NuGet\Install-Package ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions -Version 10.0.0-beta.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions" Version="10.0.0-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions" Version="10.0.0-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions --version 10.0.0-beta.1
                    
#r "nuget: ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions, 10.0.0-beta.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions@10.0.0-beta.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions&version=10.0.0-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions&version=10.0.0-beta.1&prerelease
                    
Install as a Cake Tool

Persona.Abstractions

این پروژه قراردادهای پایه Persona را نگه می‌دارد.

هدف آن این است که مصرف‌کننده بتواند بدون وابستگی مستقیم به ASP.NET Core یا جزئیات host، به اطلاعات کاربر جاری دسترسی داشته باشد.


مسئولیت‌ها

این پروژه مسئول این موارد است:

  • تعریف ICurrentUser
  • تعریف IWebCurrentUser
  • نگه‌داری API مصرفی Persona
  • حفظ مرز abstraction از implementation

قراردادها

ICurrentUser

قرارداد پایه برای دسترسی به اطلاعات هویتی کاربر جاری.

اعضای اصلی:

  • UserId
  • UserName
  • FirstName
  • LastName
  • IsAuthenticated
  • GetClaim(string claimType)
  • GetClaims(string claimType)

IWebCurrentUser

قرارداد وبی Persona که از ICurrentUser ارث می‌برد و اطلاعات زیر را اضافه می‌کند:

  • IpAddress
  • UserAgent

اصل طراحی

این پروژه نباید:

  • به ASP.NET Core وابسته باشد
  • implementation در خود داشته باشد
  • concernهای runtime یا host-specific را در surface API پخش کند

هدف این پروژه فقط تعریف مرز مصرفی روشن برای current user access است.


چه چیزهایی در این پروژه نیست

این پروژه عمداً شامل این موارد نیست:

  • پیاده‌سازی مبتنی بر HttpContext
  • registration
  • options
  • helperهای ASP.NET Core
  • login / logout
  • authorization concernها
  • profile concernها

این موارد در پروژه implementation قرار می‌گیرند یا اساساً خارج از scope Persona هستند.


نقش در معماری

Persona.Abstractions مرز stable و قابل‌ارجاع Persona است.

هر بخشی که فقط به current user access نیاز دارد باید تا حد ممکن به این پروژه وابسته شود، نه به implementation وبی.

این تصمیم باعث می‌شود:

  • coupling کاهش یابد
  • تست‌پذیری بهتر شود
  • مرز capability روشن بماند
  • host-specific concerns به مصرف‌کننده نشت نکنند

جمع‌بندی

این پروژه کوچک اما کلیدی است، چون قرارداد اصلی Persona را تعریف می‌کند و مبنای استفاده یکدست از current user در سطح پروژه را فراهم می‌سازد.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ZaminX.BuildingBlocks.IdentityAndUsers.Persona.Abstractions:

Package Downloads
ZaminX.BuildingBlocks.IdentityAndUsers.Persona.AspNetCore

Package Description

ZaminX.ApplicationPatterns.HandlerExecution

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0-beta.1 748 4/13/2026