MasLazu.AspNet.Authentication.Core.Domain 1.0.0-preview.10

This is a prerelease version of MasLazu.AspNet.Authentication.Core.Domain.
dotnet add package MasLazu.AspNet.Authentication.Core.Domain --version 1.0.0-preview.10
                    
NuGet\Install-Package MasLazu.AspNet.Authentication.Core.Domain -Version 1.0.0-preview.10
                    
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="MasLazu.AspNet.Authentication.Core.Domain" Version="1.0.0-preview.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MasLazu.AspNet.Authentication.Core.Domain" Version="1.0.0-preview.10" />
                    
Directory.Packages.props
<PackageReference Include="MasLazu.AspNet.Authentication.Core.Domain" />
                    
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 MasLazu.AspNet.Authentication.Core.Domain --version 1.0.0-preview.10
                    
#r "nuget: MasLazu.AspNet.Authentication.Core.Domain, 1.0.0-preview.10"
                    
#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 MasLazu.AspNet.Authentication.Core.Domain@1.0.0-preview.10
                    
#: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=MasLazu.AspNet.Authentication.Core.Domain&version=1.0.0-preview.10&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MasLazu.AspNet.Authentication.Core.Domain&version=1.0.0-preview.10&prerelease
                    
Install as a Cake Tool

MasLazu.AspNet.Authentication.Core.Domain

This project contains the domain entities for the MasLazu ASP.NET Authentication Core library.

Overview

The MasLazu.AspNet.Authentication.Core.Domain project provides:

  • Domain Entities: Core business objects representing users, authentication, and reference data
  • Entity Relationships: Navigation properties defining relationships between entities
  • Base Entity Inheritance: Common properties through BaseEntity

Key Entities

Core Authentication Entities

  • User: Represents a user account with profile information
  • LoginMethod: Defines available authentication methods (e.g., email, phone)
  • UserLoginMethod: Junction entity linking users to their login methods
  • RefreshToken: Stores refresh token data for JWT authentication
  • UserRefreshToken: Junction entity linking users to their refresh tokens

Reference Data Entities

  • Gender: Gender reference data
  • Language: Language reference data
  • Timezone: Timezone reference data with offset information

Entity Relationships

User
├── 1:1 → Gender
├── 1:1 → Language
├── 1:1 → Timezone
└── 1:N → UserLoginMethod
    └── 1:1 → LoginMethod

User
└── 1:N → UserRefreshToken
    └── 1:1 → RefreshToken

Project Configuration

  • Target Framework: .NET 9.0
  • Implicit Usings: Enabled
  • Nullable Reference Types: Enabled

Dependencies

  • Package References:
    • MasLazu.AspNet.Framework.Domain - Base domain framework with BaseEntity

Entity Details

User Entity

  • Properties: Name, Email, PhoneNumber, Username, LanguageCode, TimezoneId, ProfilePicture, GenderCode
  • Verification Flags: IsEmailVerified, IsPhoneNumberVerified
  • Relationships: Timezone, Gender, Language, UserLoginMethods

LoginMethod Entity

  • Properties: Code, Name, Description, IsEnabled
  • Purpose: Defines available authentication methods

RefreshToken Entity

  • Properties: Token, ExpiresDate, RevokedDate
  • Purpose: JWT refresh token storage

Reference Entities

  • Gender: Code, Name
  • Language: Code, Name
  • Timezone: Identifier, Name, OffsetMinutes

Usage

These entities are used throughout the application for:

  • User management and authentication
  • JWT token handling
  • Reference data storage
  • Entity Framework Core mappings

Domain Model Principles

  • Single Responsibility: Each entity has a clear, focused purpose
  • Navigation Properties: Define relationships between entities
  • BaseEntity Inheritance: Common auditing properties (Id, CreatedAt, UpdatedAt)
  • Nullable References: Proper nullability for optional relationships

🛠️ Development Guidelines

Naming Conventions

  • Entities: PascalCase class names (e.g., User, LoginMethod)
  • Properties: PascalCase property names
  • Navigation Properties: Plural for collections (e.g., UserLoginMethods)
  • Foreign Keys: EntityName + Id pattern (e.g., UserId, TimezoneId)

Code Structure

src/MasLazu.AspNet.Authentication.Core.Domain/
├── Entities/              # Domain entity classes
├── MasLazu.AspNet.Authentication.Core.Domain.csproj
└── README.md

Best Practices

  • Inherit from BaseEntity for common properties
  • Use navigation properties for entity relationships
  • Include XML documentation for public properties
  • Use appropriate data types and constraints
  • Follow DDD principles for entity design

🤝 Contributing

  • New Entities: Follow existing patterns and naming conventions
  • Relationships: Define navigation properties appropriately
  • Properties: Use meaningful names and correct data types
  • Documentation: Add XML comments for new entities and properties
  • Validation: Consider domain validation rules

📄 License

Part of the MasLazu ASP.NET framework ecosystem.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on MasLazu.AspNet.Authentication.Core.Domain:

Package Downloads
MasLazu.AspNet.Authentication.Core.Base

Base implementations for MasLazu ASP.NET Authentication Core. Contains service implementations, JWT utilities, and application services.

MasLazu.AspNet.Authentication.Core.EfCore

Entity Framework Core implementation for MasLazu ASP.NET Authentication Core. Contains DbContext configurations and entity mappings.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.10 140 10/8/2025
1.0.0-preview.9 140 10/2/2025
1.0.0-preview.8 135 10/1/2025
1.0.0-preview.7 137 10/1/2025
1.0.0-preview.5 151 9/29/2025
1.0.0-preview.3 266 9/18/2025

See RELEASES.md for release notes.