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

Update samples for Csharp73 new generic constraints #19

Merged
merged 3 commits into from
Apr 24, 2018

Conversation

BillWagner
Copy link
Member

This PR has the following changes:

  1. Pull the existing inline samples from the language reference on where generic constraint and the programming guide for constraints on type parameters into the samples repo.
  2. Add new samples for unmanaged, System.Delegate and System.Enum.

These samples will be part of the work to address dotnet/docs#3964

/cc @OmarTawfik @jcouv

This removes them from the sub-directories in the docs repository.
// <Snippet6>
public interface IMyInterface
{
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: for the sake of the screen space, I would put all the declaration in one line.

// <Snippet9>
public class Employee
{
public Employee(string s, int i) => (Name, ID) = (s, i);
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, that's cool!

Copy link
Member Author

Choose a reason for hiding this comment

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

It's one of my favorite C# 7 tricks.

simplify an empty declaration.
Copy link

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

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

LGTM. You can merge this when ready, @BillWagner.

@BillWagner BillWagner merged commit 12fc5a4 into dotnet:master Apr 24, 2018
@BillWagner BillWagner deleted the csharp73-new-generic-constraints branch April 24, 2018 20:07
@mairaw mairaw added the 📁 Repo - samples Indicates PRs done in the samples repo. label Apr 27, 2018
karelz pushed a commit to karelz/samples that referenced this pull request Aug 31, 2018
* import existing snippets

This removes them from the sub-directories in the docs repository.

* finish generics samples.

* respond to feedback.

simplify an empty declaration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📁 Repo - samples Indicates PRs done in the samples repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants