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

FIX: C# 9 new feature (Top-level statements) invalidate Basics (needs to be updated) #1974

Open
Farhaduneci opened this issue Sep 15, 2022 · 0 comments

Comments

@Farhaduneci
Copy link

Hey there,
Hope you be ok.

Starting in C# 9, there's no need to explicitly include a Main method in a console application project. Instead, we can use the top-level statements feature to minimize the code we have to write. In this case, the compiler generates a class and Main method entry point for the application.

Here's a Program.cs file that is a complete C# program in C# 10:

Console.WriteLine("Hello World!");

The Basics concept file includes the statement “C# is an object-oriented language and requires all functions to be defined in a class” which is not %100 true anymore. I recommend updating this file to include a hint for the new feature of the language so there be no mistakes in the text.

~ Thank you for the great C# track, I'll be happy to fix this issue if that's needed.

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