Skip to content

karenpayneoregon/top-level-csharp

Repository files navigation

About

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

Included projects

  • BasicConsoleApp demonstrates a basic top-level console project
  • BasicUsingInternalClassesApp 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 in DataLibrary

More code samples to be added shortly.

Requires

Releases

No releases published

Packages

No packages published

Languages