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

implement nullable prompt #1084

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

danielklecha
Copy link

@danielklecha danielklecha commented Nov 22, 2022

I implemented a solution to use TextPrompt with nullable types.
I created new interface INullablePrompt.
I was forced to change type of Validator in TextPrompt.
Example:

decimal? nullableDecimal = await new TextPrompt<decimal?>("Value?")
    .AllowEmpty()
    .ShowNullableAsync( _ansiConsole, CancellationToken.None );

@nils-a It's my proposition to fix #714.


Please upvote 👍 this pull request if you are interested in it.

@dnfadmin
Copy link

dnfadmin commented Nov 22, 2022

CLA assistant check
All CLA requirements met.

@danielklecha
Copy link
Author

@nils-a @patriksvensson Could you review my changes? Is it a desirable modification?

@danielklecha
Copy link
Author

@microsoft-github-policy-service agree

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

Successfully merging this pull request may close these issues.

Unable to get empty value from nullable instance like TextPrompt<Uri?>
2 participants