Skip to content

Add GenericHost playground sample - #912

Merged
jonsequitur merged 3 commits into
dotnet:masterfrom
NikiforovAll:generic-host-sample
May 30, 2020
Merged

Add GenericHost playground sample #912
jonsequitur merged 3 commits into
dotnet:masterfrom
NikiforovAll:generic-host-sample

Conversation

@NikiforovAll

Copy link
Copy Markdown
Contributor

Looking through PRs I found that quite a lot of folks ask for documentation and samples on how to use System.CommandLine.Hosting. Also, I think it useful to have a playground for Hosting since it allows people to play with it and share user feedback. Therefore this PR.

Fixes: #482
Relates: #671, #826, #440

<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since latest will be the latest installed on the running computer, I recommend setting this to 8 to match the other projects.

{
public class GreeterOptions
{
public string Name { get; set; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is intended to be called by the model binder, then you don't need the setter.

@jonsequitur
jonsequitur merged commit ae46306 into dotnet:master May 30, 2020
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.

Documentation of use with dependency injection

3 participants