OLT.Core.Attribute.Abstractions 9.0.0

Prefix Reserved
dotnet add package OLT.Core.Attribute.Abstractions --version 9.0.0
                    
NuGet\Install-Package OLT.Core.Attribute.Abstractions -Version 9.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.Attribute.Abstractions" Version="9.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OLT.Core.Attribute.Abstractions" Version="9.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OLT.Core.Attribute.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.Attribute.Abstractions --version 9.0.0
                    
#r "nuget: OLT.Core.Attribute.Abstractions, 9.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.Attribute.Abstractions@9.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.Attribute.Abstractions&version=9.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OLT.Core.Attribute.Abstractions&version=9.0.0
                    
Install as a Cake Tool

CI Quality Gate Status

Custom Attribute Classes

CodeAttribute & DescriptionAttribute

Enum Attribute to add a Code string value to an enum

NOTE: Description attrbute is found in the System.ComponentModel.DescriptionAttribute

public enum ApplicationTypes
{
    [Code("new-app")] 
    [Description("New Application")] 
    New = 1000,

    [Code("renew-app")] 
    [Description("Renew Application")] 
    Renew = 2000,
}
GetCodeEnum Extension

Extension to return string value from CodeAttribute

ApplicationTypes.New.GetCodeEnum();  //new-app

ApplicationTypes.Renew.GetDescription();  //Renew Application

KeyValueAttribute

public enum ApplicationTypes
{
    [KeyValue("Custom", "Another Test 1")]
    New = 1000,

    [KeyValue("Custom", "Value Test 2")]
    [KeyValue("Another", "Another Value")]
    Renew = 2000,
}
GetKeyValueAttributes Extension

Extension to return KeyValueAttribute from Enum

ApplicationTypes.New.GetKeyValueAttributes().FirstOrDefault(p => p.Key == "Custom")?.Value;


ApplicationTypes.Renew.GetKeyValueAttributes().Where(p => p.Key == "Custom");

UniqueIdAttribute

public enum ApplicationTypes
{
    [UniqueId("1393fff9-3850-4bb2-848b-18973a9f88d0")]
    New = 1000,
}
GetKeyValueAttributes Extension

Extension to return Guid value from UniqueId

var uid = OltAttributeExtensions.GetAttributeInstance<UniqueIdAttribute, ApplicationTypes>(ApplicationTypes.New)?.UniqueId;

SortOrderAttribute

public enum ApplicationTypes
{
    [SortOrder(10)]
    New = 1000,
}
OltSortOrderAttributeExtensions Extension

Extension to return Sort Order or default value

var sortOrder = ApplicationTypes.New.GetSortOrderEnum();

Not Empty Attributes

Utility/Item/Object Description
OltNotGuidEmptyAttribute Validation that Guid is not Guid.Empty
OltNotNullAttribute Validation that object is not null

public class MyPersonModel
{
    [OltNotGuidEmpty]
    public Guid Id { get; set; }

    [StringLength(100)]
    [Required(AllowEmptyStrings = false)]
    public string Value { get; set; }

    [OltNotNull]
    public MyOtherModel Other { get; set; }

}

Product 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 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.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on OLT.Core.Attribute.Abstractions:

Package Downloads
OLT.Core.Common

Contains common generic assets and contstants for OLT Packages

OLT.Core.Model.Abstractions

Package Description

OLT.Core.EntityFrameworkCore.Abstractions

Package Description

OLT.Core.Identity.Abstractions

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.0 195 8/25/2025
9.0.0-beta-0013 269 1/30/2025
9.0.0-beta-0011 151 1/30/2025
9.0.0-beta-0009 162 12/30/2024
9.0.0-beta-0007 147 12/9/2024
9.0.0-beta-0005 96 12/2/2024
8.4.0-beta-0010 189 11/7/2024
8.4.0-beta-0005 177 10/9/2024