Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input select not being generated from Enum #2651

Open
HappyHammer72 opened this issue Feb 16, 2024 · 1 comment
Open

Input select not being generated from Enum #2651

HappyHammer72 opened this issue Feb 16, 2024 · 1 comment

Comments

@HappyHammer72
Copy link

My class is shown below, when I generate using the Blazor CRUD Scaffolding it generates rather than an Input Select.

<div class="mb-3"> <label for="employeetype" class="form-label">EmployeeType:</label> <InputText id="employeetype" @bind-Value="Employee.EmployeeType" class="form-control" /> <ValidationMessage For="() => Employee.EmployeeType" class="text-danger" /> </div>

`namespace BlazorApp5Rubbish
{
using System.ComponentModel.DataAnnotations;

public class Employee
{
    public int Id { get; set; }

    [Required]
    [MaxLength(100)]
    public string? Name { get; set; }

    [Required]
    public EmployeeType EmployeeType { get; set; }

    [Required]
    [DataType(DataType.Date)]
    public DateTime? DateOfBirth { get; set; }

    [Required]
    [MaxLength(255)]
    public string? EmailAddress { get; set; }

    public bool IsActive { get; set; }
}

public enum EmployeeType
{
    Permanant = 0,
    Contract = 1
}

}
`

@deepchoudhery
Copy link
Contributor

deepchoudhery commented Feb 16, 2024

Will take a look at this soon tyty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants