Namespace declaration can be simplified
7
8#nullable disable
9
10namespace CustomerAPI.Migrations11{
12 [DbContext(typeof(DataContext))]
13 partial class DataContextModelSnapshot : ModelSnapshot
Namespace declaration can be simplified
2
3#nullable disable
4
5namespace CustomerAPI.Migrations 6{
7 public partial class CreateInitial : Migration
8 {
Namespace declaration can be simplified
8
9#nullable disable
10
11namespace CustomerAPI.Migrations12{
13 [DbContext(typeof(DataContext))]
14 [Migration("20220604151018_CreateInitial")]
Namespace declaration can be simplified
1using Microsoft.EntityFrameworkCore;
2
3namespace CustomerAPI.Data 4{
5 public class DataContext : DbContext
6 {
Namespace declaration can be simplified
1namespace CustomerAPI 2{
3 public class Customer
4 {
Namespace declaration can be simplified
2using Microsoft.AspNetCore.Mvc;
3using Microsoft.EntityFrameworkCore;
4
5namespace CustomerAPI.Controllers 6{
7 [Route("api/[controller]")]
8 [ApiController]
Description
Typical namespace
s require that all the members in it be indented. With the additional of classes, methods, and scopes, the indentation level further increases, thereby affecting the code readability, navigation, and clarity. C# 10 introduces file scoped namespaces that do not require members' indentation. It is therefore recommended that you switch to file scoped namespaces when and where possible.
Bad Practice
namespace Foo
{
// ...
}
Recommended
namespace Foo;
// ...