What does a file-scoped namespace declaration such as namespace MyApp.Models; do in C# 10 and later?
Correct answer C. It places every type in the file into that namespace without an extra pair of braces
Explanation
A file-scoped namespace applies to the whole file, so you avoid one level of braces and indentation. Types declared after it belong to MyApp.Models exactly as with a block-scoped namespace and are visible elsewhere. Importing a namespace is done with a using directive. A file can contain only one file-scoped namespace declaration.
Answer checked How we write and check questions
Discussion