8000 Value Validator feature request · Issue #77 · devlooped/StructId · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Value Validator feature request #77
Open
@truegoodwill

Description

@truegoodwill

It would be really cool if I could provide the following method on my value type:

public bool IsValid(TValue value) => return some result;

And have the constructors and parsers throw an exception if the incoming value is not valid, if the above method exists on my struct id type.

For example, some of my string-based ids are just a hard-coded list of six values, like this (pardon me for using StronglyTypedId here haha), and when they arrive via rest request, after switching it to StructId, I'd like to validate that they are one of these particular values.

Image

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0