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
<PackageReference Include="Studiocode.Blazor.GeneratorLib" Version="1.0.1" />
<PackageVersion Include="Studiocode.Blazor.GeneratorLib" Version="1.0.1" />
<PackageReference Include="Studiocode.Blazor.GeneratorLib" />
paket add Studiocode.Blazor.GeneratorLib --version 1.0.1
#r "nuget: Studiocode.Blazor.GeneratorLib, 1.0.1"
#:package Studiocode.Blazor.GeneratorLib@1.0.1
#addin nuget:?package=Studiocode.Blazor.GeneratorLib&version=1.0.1
#tool nuget:?package=Studiocode.Blazor.GeneratorLib&version=1.0.1
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 | Versions 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. |
-
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 |