Starting in C# 9, you don't have to explicitly include a Main method in a console application project. Instead, you can use the top-level statements
feature to minimize the code you have to write. In this case, the compiler generates a class and Main method entry point for the application.
See Microsoft docs: Top-level statements
BasicConsoleApp
demonstrates a basic top-level console projectBasicUsingInternalClassesApp
demonstrates accessing functionality with classes in the same project.BasicEntityFrameworkCoreApp
provides a simple read from a SQL-Server database using Entity Framework Core- BasicConsoleWithLocalSwitchApp example using switch expression
- WorkingWithDataConsoleApp shows working with
- Class project
DataLibrary
to read json data - Class project
ContainerLibrary
with concrete classes used inDataLibrary
- Class project
More code samples to be added shortly.
- .NET Core 5 or higher
- Microsoft Visual Studio 2019 or higher
- Newtonsoft.Json which can be swapped out for System.Json
- SQL-Server Express edition or better