VOOZH about

URL: https://www.nuget.org/packages/OLT.Core.Model.Abstractions/

⇱ NuGet Gallery | OLT.Core.Model.Abstractions 10.0.0




👁 Image
OLT.Core.Model.Abstractions 10.0.0

Prefix Reserved
dotnet add package OLT.Core.Model.Abstractions --version 10.0.0
 
 
NuGet\Install-Package OLT.Core.Model.Abstractions -Version 10.0.0
 
 
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="OLT.Core.Model.Abstractions" Version="10.0.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OLT.Core.Model.Abstractions" Version="10.0.0" />
 
Directory.Packages.props
<PackageReference Include="OLT.Core.Model.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 OLT.Core.Model.Abstractions --version 10.0.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OLT.Core.Model.Abstractions, 10.0.0"
 
 
#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 OLT.Core.Model.Abstractions@10.0.0
 
 
#: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=OLT.Core.Model.Abstractions&version=10.0.0
 
Install as a Cake Addin
#tool nuget:?package=OLT.Core.Model.Abstractions&version=10.0.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

👁 CI
👁 Quality Gate Status

General Model Classes and Interfaces. Includes Constant Classes

OltClaimTypes

List of registered claims from different sources

https://datatracker.ietf.org/doc/html/rfc7519#section-4 http://openid.net/specs/openid-connect-core-1_0.html#IDToken https://github.com/openiddict/openiddict-core/blob/dev/src/OpenIddict.Abstractions/OpenIddictConstants.cs https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/23808d5c7b11c3e0e9f202e48129c054e2b4f7ab/src/Microsoft.IdentityModel.JsonWebTokens/JwtRegisteredClaimNames.cs

Models

I use naming convention "Json" on the end of a class to indicate it's exposed from an API controller (i.e., MyDataJson)

OltPersonName & IOltPersonName
OltAuthenticatedUserJson & OltAuthenticatedUserJwtTokenJson
OltFileBase64 & IOltFileBase64 - Represents a file encoded as a base64 string
IOltPaged - Paged resultset
OltPagingParams & IOltPagingParams - Paged Parameter Class used by an ASP.Net Controller Parameter
OltPagedJson & IOltPagedJson - Paged Json Model
OltPagedSearchJson - Paged Resultset with the search criteria class included
[Route("api/my-search-example")]
[RequirePermission(SecurityPermissions.ReadOnly)]
public class SearchController : BaseApiController
{
 private readonly IMyRepoService _service;

 public SearchController(
 IMyRepoService service,
 IHelperService helperService) : base(helperService)
 {
 _service = service;
 }

 [HttpPost, Route("")]
 public async Task<ActionResult<SearchKeyJson>> Search([FromBody] SearchCriteriaJson criteria)
 {
 return Ok(await _service.SearchAsync(new MySearcher(criteria)));
 }

 [HttpGet, Route("{searchKey}")]
 public async Task<ActionResult<OltPagedSearchJson<SearchResultJson, SearchCriteriaJson>>> GetSearch(string searchKey, [FromQuery] OltPagingParams @params)
 {
 return Ok(await _service.GetPagedAsync(searchKey, @params));
 }
}

OltIdentity

Injectable Identity wrapper from IOltIdentity

Abstract wrapper class that requires System.Security.Claims.ClaimsPrincipal.

Example using IHttpContextAccessor for a Asp.net Core web project with a Custom Claim

public interface IAppIdentity : IOltIdentity
{
 string? MyCustomClaim { get; }
}

public class AppIdentity : OltIdentity, IAppIdentity
{
 private readonly IHttpContextAccessor _httpContext;
 

 public AppIdentity(IHttpContextAccessor httpContext)
 {
 
 _httpContext = httpContext;
 }

 public override ClaimsPrincipal Identity => _httpContext?.HttpContext?.User;

 public string? MyCustomClaim => GetClaims("MyCustomClaim").FirstOrDefault()?.Value; 
}


...

//Note: add to DI
services
 .AddScoped<IAppIdentity, AppIdentity>();

Example for a console app or batch service using a Role Enum

// An enum used for a role using custom attribute "CodeAttribute" from OLT.Core.Attribute.Abstractions
public enum SecurityRoles 
{
 [Code("read-only")]
 [Description("View all records")]
 ReadOnly = 1000
}


public class BatchServiceIdentity : OltIdentity, IOltIdentity
{
 public BatchServiceIdentity()
 {
 }

 public const string SERVICE_NAME = "Batch Service";
 public override string NameId => "Unique Id boes into this claim";
 public override string Username => SERVICE_NAME;


 public override ClaimsPrincipal Identity
 {
 get
 {
 var roles = new List<string>();
 foreach (SecurityRoles role in Enum.GetValues(typeof(SecurityRoles)))
 {
 roles.Add(role.GetCodeEnum());
 }
 return new GenericPrincipal(new GenericIdentity(SERVICE_NAME), roles.ToArray());
 }
 }
}


public class MyExampleService : OltCoreService, IMyExampleService
{
 private readonly IOltIdentity _identity;

 public ReportManager(IOltIdentity identity)

 {
 _identity = identity;
 }

 public void ExampleMethod()
 {
 if (_identity.HasRole(SecurityRoles.ReadOnly)) 
 {
 //The Identity has the role
 }
 
 Debug.WriteLine(_identity.Username);
 Debug.WriteLine(_identity.NameId);
 Debug.WriteLine(_identity.FirstName);
 Debug.WriteLine(_identity.LastName);

 }

 
}


...

//Note: add to DI
services.AddScoped<IOltIdentity, BatchServiceIdentity>();


Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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 (7)

Showing the top 5 NuGet packages that depend on OLT.Core.Model.Abstractions:

Package Downloads
OLT.EF.Core

Base Context, Context Extensions, Seed Helpers, Entity Interfaces, Base Entity Models

OLT.AspNetCore.Authentication.JwtBearer

OLT AspNetCore Autentication for JWT Tokens

OLT.Core.Common.Abstractions

Package Description

OLT.Core.Service.Abstractions

Package Description

OLT.Core.EntityFrameworkCore.Abstractions

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0 574 2/25/2026
10.0.0-beta-0001 369 12/26/2025
9.0.0 781 8/25/2025
9.0.0-beta-0013 499 1/30/2025
9.0.0-beta-0011 334 1/30/2025
9.0.0-beta-0009 348 12/30/2024
9.0.0-beta-0007 365 12/9/2024
9.0.0-beta-0005 329 12/2/2024
8.4.0-beta-0010 578 11/7/2024
8.4.0-beta-0005 557 10/9/2024