Skip to content

Commit 1d06ae9

Browse files
author
Anthony Sneed
committed
Update CustomerService.csproj to nullable.
1 parent 2c00798 commit 1d06ae9

File tree

18 files changed

+74
-143
lines changed

18 files changed

+74
-143
lines changed

reference-architecture/CustomerService/Configuration/CustomerDatabaseSettings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ namespace CustomerService.Configuration
44
{
55
public class CustomerDatabaseSettings : IMongoDbSettings
66
{
7-
public string ConnectionString { get; set; }
8-
public string DatabaseName { get; set; }
9-
public string CollectionName { get; set; }
7+
public string ConnectionString { get; set; } = null!;
8+
public string DatabaseName { get; set; } = null!;
9+
public string CollectionName { get; set; } = null!;
1010
}
1111
}

reference-architecture/CustomerService/Controllers/CustomerCommandController.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Threading.Tasks;
3-
using AutoMapper;
1+
using AutoMapper;
42
using CustomerService.Domain.CustomerAggregate;
53
using CustomerService.Domain.CustomerAggregate.CommandHandlers;
64
using CustomerService.Domain.CustomerAggregate.Commands;

reference-architecture/CustomerService/Controllers/CustomerQueryController.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Threading.Tasks;
4-
using AutoMapper;
1+
using AutoMapper;
52
using CustomerService.DTO.Read;
63
using CustomerService.Repositories;
74
using Microsoft.AspNetCore.Mvc;

reference-architecture/CustomerService/CustomerService.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
57
</PropertyGroup>
68

79
<ItemGroup>
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
using System;
2-
31
namespace CustomerService.DTO.Read
42
{
53
public class CustomerView
64
{
75
public Guid Id { get; set; }
8-
public string FirstName { get; set; }
9-
public string LastName { get; set; }
10-
public string Street { get; set; }
11-
public string City { get; set; }
12-
public string State { get; set; }
13-
public string Country { get; set; }
14-
public string PostalCode { get; set; }
15-
public string ETag { get; set; }
6+
public string FirstName { get; set; } = null!;
7+
public string LastName { get; set; } = null!;
8+
public string Street { get; set; } = null!;
9+
public string City { get; set; } = null!;
10+
public string State { get; set; } = null!;
11+
public string Country { get; set; } = null!;
12+
public string PostalCode { get; set; } = null!;
13+
public string ETag { get; set; } = null!;
1614
}
1715
}

reference-architecture/CustomerService/DTO/Write/Address.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ namespace CustomerService.DTO.Write
22
{
33
public class Address
44
{
5-
public string Street { get; set; }
6-
public string City { get; set; }
7-
public string State { get; set; }
8-
public string Country { get; set; }
9-
public string PostalCode { get; set; }
5+
public string Street { get; set; } = null!;
6+
public string City { get; set; } = null!;
7+
public string State { get; set; } = null!;
8+
public string Country { get; set; } = null!;
9+
public string PostalCode { get; set; } = null!;
1010
}
1111
}
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
using System;
2-
31
namespace CustomerService.DTO.Write
42
{
53
public class Customer
64
{
75
public Guid Id { get; set; }
8-
public string FirstName { get; set; }
9-
public string LastName { get; set; }
10-
public Address ShippingAddress { get; set; }
11-
public string ETag { get; set; }
6+
public string FirstName { get; set; } = null!;
7+
public string LastName { get; set; } = null!;
8+
public Address ShippingAddress { get; set; } = null!;
9+
public string ETag { get; set; } = null!;
1210
}
1311
}

reference-architecture/CustomerService/Domain/CustomerAggregate/CommandHandlers/CustomerCommandHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using System.Threading.Tasks;
21
using AutoMapper;
32
using Common.Integration.Events;
43
using CustomerService.Domain.CustomerAggregate.Commands;
54
using CustomerService.Repositories;
65
using EventDriven.DDD.Abstractions.Commands;
6+
using EventDriven.DDD.Abstractions.Repositories;
77
using EventDriven.EventBus.Abstractions;
8-
using Microsoft.Extensions.Logging;
98
using Integration = Common.Integration;
109

1110
namespace CustomerService.Domain.CustomerAggregate.CommandHandlers

reference-architecture/CustomerService/Domain/CustomerAggregate/Commands/RemoveCustomer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using EventDriven.DDD.Abstractions.Commands;
32

43
namespace CustomerService.Domain.CustomerAggregate.Commands

reference-architecture/CustomerService/Domain/CustomerAggregate/Customer.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using CustomerService.Domain.CustomerAggregate.Commands;
32
using CustomerService.Domain.CustomerAggregate.Events;
43
using EventDriven.DDD.Abstractions.Commands;
@@ -12,9 +11,9 @@ public class Customer :
1211
ICommandProcessor<CreateCustomer, CustomerCreated>,
1312
IEventApplier<CustomerCreated>
1413
{
15-
public string FirstName { get; set; }
16-
public string LastName { get; set; }
17-
public Address ShippingAddress { get; set; }
14+
public string FirstName { get; set; } = null!;
15+
public string LastName { get; set; } = null!;
16+
public Address ShippingAddress { get; set; } = null!;
1817

1918
public CustomerCreated Process(CreateCustomer command)
2019
// To process command, return one or more domain events

0 commit comments

Comments
 (0)