Skip to content

EnumListHandler should skip lists that have an ExistsIn attribute #150

@fsateler

Description

@fsateler

This way one could have a form using an enum but limiting the usable values (useful for when one is creating multiple distinct forms for the same general operation), or replacing the enum text values.

public override bool CanHandle() => 
    GetUnderlyingType(FieldGenerator).IsEnum && !HasExistInAttibute();

private bool HasExistInAttibute() => 
    FieldGenerator.Metadata.AdditionalValues.ContainsKey(ExistsInAttribute.ExistsKey)
    && FieldGenerator.Metadata.AdditionalValues[ExistsInAttribute.ExistsKey] as bool? == true;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions