Bielu.Umbraco.Generators.Dictionaries 1.1.1

Prefix Reserved
dotnet add package Bielu.Umbraco.Generators.Dictionaries --version 1.1.1                
NuGet\Install-Package Bielu.Umbraco.Generators.Dictionaries -Version 1.1.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="Bielu.Umbraco.Generators.Dictionaries" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bielu.Umbraco.Generators.Dictionaries --version 1.1.1                
#r "nuget: Bielu.Umbraco.Generators.Dictionaries, 1.1.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.
// Install Bielu.Umbraco.Generators.Dictionaries as a Cake Addin
#addin nuget:?package=Bielu.Umbraco.Generators.Dictionaries&version=1.1.1

// Install Bielu.Umbraco.Generators.Dictionaries as a Cake Tool
#tool nuget:?package=Bielu.Umbraco.Generators.Dictionaries&version=1.1.1                

❤️ This project is royalty free and open source, so if you using and love it, you can support it by becoming Github sponsor ❤️

Bielu.Umbraco.Generators.Dictionaries

This package allows to generated class with access to alias, key (guid) and id (int) of dictionaries. By default package is listening to Umbraco Models configuration:

  • package is enabled only when ModelsMode is ModelsMode.SourceCodeAuto or ModelsMode.SourceCodeManual, there will be no support for InMemoryAuto
  • It will replace word models in end of path for ModelsDirectory, example umbraco\models will become umbraco\constants, to avoid overriding by ModelsBuilder, in case word models is not found it will create file in same folder as ModelsBuilder, and till https://github.com/umbraco/Umbraco-CMS/discussions/17869 is consider I recommend adding "models" to the end of custom path to avoid losing content of this file.
  • It will generate file with name Dictionaries.cs
  • it will generate file with same namespace as ModelsBuilder

Example generated file:

//------------------------------------------------------------------------------
// <auto-generated>
/// This file is autogenerated by Bielu.Umbraco.Generators.Dictionaries v1.0.0
/// </auto-generated>
//------------------------------------------------------------------------------
namespace Umbraco.Cms.Web.Common.PublishedModels;
#pragma warning disable IDE1006 // Naming Styles
// ReSharper disable InconsistentNaming
public static class Dictionaries
{
    public static class Test1
    {
        public const string Alias = "Test 1";
        public static readonly Guid Key = new Guid("8ea9e450-f0bf-4100-aeb5-fa56c5cad1e8");
        public const int Id = 1;
        //SubDictionaries of level 1 (if any)
        public static class Test1_1
        {
            public const string Alias = "Test1_1";
            public static readonly Guid Key = new Guid("537d017f-37a3-4106-a660-11c3b74dd09d");
            public const int Id = 3;
            //SubDictionaries of level 2 (if any)
        }
        public static class Test11
        {
            public const string Alias = "Test1.1";
            public static readonly Guid Key = new Guid("c7755fec-affb-42f9-a012-f737dce18b1a");
            public const int Id = 2;
            //SubDictionaries of level 2 (if any)
        }
    }
}
#pragma warning restore IDE1006 // Naming Styles

Docs

TBC

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

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.1.1 72 1/3/2025
1.1.0 58 1/1/2025
1.0.2 42 12/31/2024
1.0.1 41 12/31/2024
1.0.0 44 12/30/2024