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

Support coding guidelines for C# 9.0 #15

Open
wcoder opened this issue Dec 14, 2020 · 0 comments
Open

Support coding guidelines for C# 9.0 #15

wcoder opened this issue Dec 14, 2020 · 0 comments

Comments

@wcoder
Copy link
Member

wcoder commented Dec 14, 2020

https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9

Pattern matching enhancements

new

if (e is not null)
{
    // ...
}

or

if (e != null)
{
    // ...
}
  • t is not > 4 or not < 10 and not 0 and 0

Fit and finish features

new

var a = CreateA();

// ...

public A CreateA()
{
    // ...
    
	return new() // <-- here
	{
		Str = "some text"
	};
}

or

public A CreateA()
{
    // ...
    
	return new A // <-- here
	{
		Str = "some text"
	};
}

new

StringBuilder sb = new();

or

var sb = new StringBuilder();

TODO...

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

No branches or pull requests

1 participant