Skip to content

Commit

Permalink
Fixed most nullable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DAQEM committed Nov 6, 2023
1 parent 081efe7 commit c3076fb
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 23 deletions.
6 changes: 6 additions & 0 deletions Netmon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APIGateway", "Services\APIG
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Netmon.SNMPPolling.IntegrationTests", "Tests\Netmon.SNMPPolling.IntegrationTests\Netmon.SNMPPolling.IntegrationTests.csproj", "{FA4A11D4-301E-4164-8E58-CE9250C879EF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountService", "Services\AccountService\AccountService.csproj", "{11DAA84F-2522-49DF-BAE2-957DA1AEB2BC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -66,5 +68,9 @@ Global
{FA4A11D4-301E-4164-8E58-CE9250C879EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA4A11D4-301E-4164-8E58-CE9250C879EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA4A11D4-301E-4164-8E58-CE9250C879EF}.Release|Any CPU.Build.0 = Release|Any CPU
{11DAA84F-2522-49DF-BAE2-957DA1AEB2BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11DAA84F-2522-49DF-BAE2-957DA1AEB2BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11DAA84F-2522-49DF-BAE2-957DA1AEB2BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11DAA84F-2522-49DF-BAE2-957DA1AEB2BC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions Services/AccountService/Models/LoginModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

public class LoginModel
{
public string Email { get; set; }
public string Password { get; set; }
public string Email { get; set; } = null!;
public string Password { get; set; } = null!;
}
2 changes: 1 addition & 1 deletion Services/AccountService/Models/LogoutModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public class LogoutModel
{
public string SessionId { get; set; }
public string SessionId { get; set; } = null!;
}
6 changes: 3 additions & 3 deletions Services/AccountService/Models/RegisterModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class RegisterModel
{
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string Username { get; set; } = null!;
public string Email { get; set; } = null!;
public string Password { get; set; } = null!;
}
2 changes: 1 addition & 1 deletion Services/AccountService/Models/SessionDetailsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

public class SessionDetailsModel
{
public string Id { get; set; }
public string Id { get; set; } = null!;
public DateTime Expires { get; set; }
}
8 changes: 4 additions & 4 deletions Services/AccountService/Models/UserDetailsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

public class UserDetailsModel
{
public string Username { get; set; }
public string Email { get; set; }
public List<string> Roles { get; set; }
public SessionDetailsModel Session { get; set; }
public string Username { get; set; } = null!;
public string Email { get; set; } = null!;
public List<string> Roles { get; set; } = null!;
public SessionDetailsModel Session { get; set; } = null!;
}
2 changes: 1 addition & 1 deletion Services/AccountService/Models/VerifyModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

public class VerifyModel
{
public string SessionId { get; set; }
public string SessionId { get; set; } = null!;
}
12 changes: 6 additions & 6 deletions Shared/Netmon.Models/Device/Connection/DeviceConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ namespace Netmon.Models.Device.Connection;

public class DeviceConnection : IDeviceConnection
{
public int Port { get; set; }
public int Port { get; set; } = -1;

public string Community { get; set; }
public string Community { get; set; } = null!;

public string AuthPassword { get; set; }
public string AuthPassword { get; set; } = null!;

public string PrivacyPassword { get; set; }
public string PrivacyPassword { get; set; } = null!;

public AuthProtocol AuthProtocol { get; set; }

public PrivacyProtocol PrivacyProtocol { get; set; }

public string ContextName { get; set; }
public string ContextName { get; set; } = null!;

public int SNMPVersion { get; set; }
public int SNMPVersion { get; set; } = -1;
}
10 changes: 5 additions & 5 deletions Shared/Netmon.Models/Device/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ namespace Netmon.Models.Device;

public class Device : IDevice
{
public string IpAddress { get; set; }
public string IpAddress { get; set; } = null!;
public string? Name { get; set; }
public string? Location { get; set; }
public string? Contact { get; set; }
public IDeviceConnection? DeviceConnection { get; set; }
public List<IDisk> Disks { get; set; }
public List<ICpu> Cpus { get; set; }
public List<IMemory> Memory { get; set; }
public List<IInterface> Interfaces { get; set; }
public List<IDisk> Disks { get; set; } = null!;

Check warning on line 16 in Shared/Netmon.Models/Device/Device.cs

View workflow job for this annotation

GitHub Actions / device_manager_service

Nullability of reference types in type of parameter 'value' of 'void Device.Disks.set' doesn't match implicitly implemented member 'void IDevice.Disks.set' (possibly because of nullability attributes).

Check warning on line 16 in Shared/Netmon.Models/Device/Device.cs

View workflow job for this annotation

GitHub Actions / snmp_polling_service

Nullability of reference types in type of parameter 'value' of 'void Device.Disks.set' doesn't match implicitly implemented member 'void IDevice.Disks.set' (possibly because of nullability attributes).
public List<ICpu> Cpus { get; set; } = null!;

Check warning on line 17 in Shared/Netmon.Models/Device/Device.cs

View workflow job for this annotation

GitHub Actions / device_manager_service

Nullability of reference types in type of parameter 'value' of 'void Device.Cpus.set' doesn't match implicitly implemented member 'void IDevice.Cpus.set' (possibly because of nullability attributes).

Check warning on line 17 in Shared/Netmon.Models/Device/Device.cs

View workflow job for this annotation

GitHub Actions / snmp_polling_service

Nullability of reference types in type of parameter 'value' of 'void Device.Cpus.set' doesn't match implicitly implemented member 'void IDevice.Cpus.set' (possibly because of nullability attributes).
public List<IMemory> Memory { get; set; } = null!;

Check warning on line 18 in Shared/Netmon.Models/Device/Device.cs

View workflow job for this annotation

GitHub Actions / device_manager_service

Nullability of reference types in type of parameter 'value' of 'void Device.Memory.set' doesn't match implicitly implemented member 'void IDevice.Memory.set' (possibly because of nullability attributes).

Check warning on line 18 in Shared/Netmon.Models/Device/Device.cs

View workflow job for this annotation

GitHub Actions / snmp_polling_service

Nullability of reference types in type of parameter 'value' of 'void Device.Memory.set' doesn't match implicitly implemented member 'void IDevice.Memory.set' (possibly because of nullability attributes).
public List<IInterface> Interfaces { get; set; } = null!;

Check warning on line 19 in Shared/Netmon.Models/Device/Device.cs

View workflow job for this annotation

GitHub Actions / device_manager_service

Nullability of reference types in type of parameter 'value' of 'void Device.Interfaces.set' doesn't match implicitly implemented member 'void IDevice.Interfaces.set' (possibly because of nullability attributes).

Check warning on line 19 in Shared/Netmon.Models/Device/Device.cs

View workflow job for this annotation

GitHub Actions / snmp_polling_service

Nullability of reference types in type of parameter 'value' of 'void Device.Interfaces.set' doesn't match implicitly implemented member 'void IDevice.Interfaces.set' (possibly because of nullability attributes).
}

0 comments on commit c3076fb

Please sign in to comment.