Studiocode.Blazor.GeneratorLib 1.0.1

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

To use GeneratorLib

This package provides data attributes to assign to individual properties of data-model classes. There is an enumerative defined like this:

public enum EFType
{
    Text,
    Date,
    DateTime,
    Int,
    Double,
    Bool,
    Multiline, // needs rows and cols
    ComboBox, // needs value, text, class and datatype
    Radio // needs enumerative
}

Examples:

public class Person
{
    [Key]
    public int ID { get; set; }
    
    [Required(ErrorMessage = "{0} is required!")]
    [MaxLength(100)]
    [Display(Name = "Name")]
    [EfData(EFType.Text)]
    public string Name { get; set; }
    
    [Required(ErrorMessage = "{0} is required!")]
    [MaxLength(100)]
    [Display(Name = "LastName")]
    [EfData(EFType.Text)]
    public string LastName { get; set; }
    
    [Required(ErrorMessage = "{0} is required!")]
    [EfData(EFType.Date)]
    [Display(Name = "BirthDate")]
    public DateTime? BirthDate { get; set; }
    
    [Required(ErrorMessage = "{0} is required!")]
    [Display(Name = "Notes")]
    [EfData(EFType.Multiline, 40, 50)]
    public string Notes { get; set; }
}

There is another enumeration to use with GridGenerator that allows you to not show properties or use them with dropdowns.

public enum EFGridType
{
FieldName,
NotShow
}

Example, this class created for EntityFramework:

public class Fattura
{
    [Key]
    [EfDataGrid(EFGridType.NotShow)]
    public int ID { get; set; }
    
    [StringLength(4)]
    [Unicode(false)]
    [Display(Name = "Codice")]
    [EfData(EFType.Text)]
    public string Codice { get; set; } = null!;
    
    [Display(Name = "Data fattura")]
    [EfData(EFType.Date)]
    [Column(TypeName = "datetime")]
    public DateTime? DataFattura { get; set; }
    
    [Display(Name = "Amount")]
    [EfData(EFType.Double)]
    [Column(TypeName = "smallmoney")]
    public double? Amount { get; set; }
    
    [StringLength(250)]
    [Unicode(false)]
    [Display(Name = "Description")]
    [EfData(EFType.Multiline, 5, 20)]
    public string Description { get; set; } = null!;
    
    [Required]
    [EfData(EFType.ComboBox, "ID", "Name", nameof(Customer), "int")]
    [Display(Name = "Customer")]
    [EfDataGrid(EFGridType.NotShow)]
    public int Customer_ID { get; set; }
    [ForeignKey("Customer_ID")]
    [EfDataGrid(EFGridType.FieldName, "Name", "Customer")]
    public Customer Customer { get; set; }

}

and this is Cliente data-model class:

public class Cliente
{
    [Key]
    public int ID { get; set; }

    [Required]
    [StringLength(50)]
    [Unicode(false)]
    [Display(Name = "Nome")]
    [EfData(EFType.Text)]
    public string Nome { get; set; }
    
    [StringLength(50)]
    [Unicode(false)]
    [Display(Name = "Sede")]
    [EfData(EFType.Text)]
    public string Sede { get; set; } = null!;
}
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.  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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Studiocode.Blazor.GeneratorLib:

Package Downloads
Studiocode.Blazor.EditFormGenerator

EditForm generator from custom class model with attributes

Studiocode.Blazor.GridGenerator

Generate Blazor Bootstrap Grid from custom class model with attributes

Studiocode.Blazor.CrudGenerator

Generate grid and editform from custom class model with attributes

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 291 6/21/2025