diff --git a/AsbCloudApp/Comparators/ComparerIId.cs b/AsbCloudApp/Comparators/ComparerIId.cs index 93b0d91a..4c02af80 100644 --- a/AsbCloudApp/Comparators/ComparerIId.cs +++ b/AsbCloudApp/Comparators/ComparerIId.cs @@ -25,12 +25,8 @@ namespace AsbCloudApp.Comparators /// /// public int Compare(IId? x, IId? y) - { - if (x is null || y is null) - return 0; - else - return x.Id.CompareTo(y.Id); - } + => (x?.Id??0).CompareTo(y?.Id??0); + /// /// @@ -39,11 +35,11 @@ namespace AsbCloudApp.Comparators /// /// public bool Equals(IId? x, IId? y) - { - if (x is null || y is null) - return false; - else + { + if (x is not null && y is not null) return x.Id == y.Id; + + return x == y; } /// diff --git a/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs b/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs index eac2d83d..2c8035ed 100644 --- a/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs +++ b/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs @@ -9,12 +9,10 @@ namespace AsbCloudApp.Comparators /// public bool Equals(TelemetryUserDto? prevUser, TelemetryUserDto? nextUser) { - if (prevUser is null || nextUser is null) - return false; - else if (prevUser.Id == nextUser.Id) - return true; - else - return false; + if (prevUser is not null && nextUser is not null) + return prevUser.Id == nextUser.Id; + + return prevUser == nextUser; } /// diff --git a/AsbCloudApp/Data/MapPointBaseDto.cs b/AsbCloudApp/Data/MapPointBaseDto.cs index f4580983..2a3a7ff0 100644 --- a/AsbCloudApp/Data/MapPointBaseDto.cs +++ b/AsbCloudApp/Data/MapPointBaseDto.cs @@ -11,7 +11,7 @@ /// /// Название /// - public string Caption { get; set; } = string.Empty; + public string Caption { get; set; } = null!; /// public double? Latitude { get; set; } diff --git a/AsbCloudApp/Data/MessageDto.cs b/AsbCloudApp/Data/MessageDto.cs index a8b982c2..b8d930c5 100644 --- a/AsbCloudApp/Data/MessageDto.cs +++ b/AsbCloudApp/Data/MessageDto.cs @@ -28,7 +28,7 @@ namespace AsbCloudApp.Data /// /// пользователь панели оператора /// - public string User { get; set; } = null!; + public string? User { get; set; } /// /// текст сообщения diff --git a/AsbCloudApp/Data/ReportProgressDto.cs b/AsbCloudApp/Data/ReportProgressDto.cs index b1c15479..c7bf4cbb 100644 --- a/AsbCloudApp/Data/ReportProgressDto.cs +++ b/AsbCloudApp/Data/ReportProgressDto.cs @@ -13,7 +13,7 @@ /// /// название текущей операции генерации /// - public string Operation { get; set; } = string.Empty; + public string? Operation { get; set; } /// /// номер текущей страницы diff --git a/AsbCloudApp/Data/ReportPropertiesDto.cs b/AsbCloudApp/Data/ReportPropertiesDto.cs index e8527d90..217f7598 100644 --- a/AsbCloudApp/Data/ReportPropertiesDto.cs +++ b/AsbCloudApp/Data/ReportPropertiesDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO формирования рапорта /// diff --git a/AsbCloudApp/Data/RequestLogDto.cs b/AsbCloudApp/Data/RequestLogDto.cs index eb3231c0..ecdb183e 100644 --- a/AsbCloudApp/Data/RequestLogDto.cs +++ b/AsbCloudApp/Data/RequestLogDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO журнала запросов /// @@ -63,5 +62,4 @@ namespace AsbCloudApp.Data /// public string? ExceptionStack { get; set; } = null!; } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Data/RequestLogUserDto.cs b/AsbCloudApp/Data/RequestLogUserDto.cs index bd39eaef..3f5d6a39 100644 --- a/AsbCloudApp/Data/RequestLogUserDto.cs +++ b/AsbCloudApp/Data/RequestLogUserDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO статистики запросов по пользователю /// @@ -48,5 +47,4 @@ namespace AsbCloudApp.Data /// public UserDto User { get; set; } = null!; } -#nullable disable } diff --git a/AsbCloudApp/Data/ScheduleDto.cs b/AsbCloudApp/Data/ScheduleDto.cs index 8e071492..cd0175b1 100644 --- a/AsbCloudApp/Data/ScheduleDto.cs +++ b/AsbCloudApp/Data/ScheduleDto.cs @@ -41,6 +41,6 @@ namespace AsbCloudApp.Data /// /// Бурильщик /// - public DrillerDto Driller { get; set; } = null!; + public DrillerDto? Driller { get; set; } } } diff --git a/AsbCloudApp/Data/SimpleTimezoneDto.cs b/AsbCloudApp/Data/SimpleTimezoneDto.cs index 100ede09..3ec75814 100644 --- a/AsbCloudApp/Data/SimpleTimezoneDto.cs +++ b/AsbCloudApp/Data/SimpleTimezoneDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// /// diff --git a/AsbCloudApp/Data/StatWellDto.cs b/AsbCloudApp/Data/StatWellDto.cs index d2ebe0ae..9793e858 100644 --- a/AsbCloudApp/Data/StatWellDto.cs +++ b/AsbCloudApp/Data/StatWellDto.cs @@ -45,7 +45,7 @@ namespace AsbCloudApp.Data /// /// статистика за всю скважину /// - public PlanFactBase? Total { get; set; } + public PlanFactBase Total { get; set; } = new(); /// /// компании участвующие в строительстве скважины diff --git a/AsbCloudApp/Data/TelemetryDto.cs b/AsbCloudApp/Data/TelemetryDto.cs index e728a022..d243c749 100644 --- a/AsbCloudApp/Data/TelemetryDto.cs +++ b/AsbCloudApp/Data/TelemetryDto.cs @@ -34,6 +34,6 @@ namespace AsbCloudApp.Data /// /// DTO скважины /// - public WellInfoDto Well { get; set; } = null!; + public WellInfoDto? Well { get; set; } } } diff --git a/AsbCloudApp/Data/TimeDto.cs b/AsbCloudApp/Data/TimeDto.cs index faf99427..6a3620f2 100644 --- a/AsbCloudApp/Data/TimeDto.cs +++ b/AsbCloudApp/Data/TimeDto.cs @@ -118,11 +118,11 @@ namespace AsbCloudApp.Data public static bool operator >(TimeDto a, TimeDto b) => a.TotalSeconds > b.TotalSeconds; /// - public int CompareTo(TimeDto other) - => TotalSeconds - other.TotalSeconds; + public int CompareTo(TimeDto? other) + => TotalSeconds - other?.TotalSeconds??0; /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (ReferenceEquals(this, obj)) {