diff --git a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/DiagnoseLogic.cs b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/DiagnoseLogic.cs index b791a09..80bd0db 100644 --- a/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/DiagnoseLogic.cs +++ b/Polyclinic/PolyclinicBusinessLogic/BusinessLogics/DiagnoseLogic.cs @@ -58,14 +58,14 @@ namespace PolyclinicBusinessLogic.BusinessLogics return element; } - public List? ReadList(DiagnoseSearchModel? model) + public List ReadList(DiagnoseSearchModel? model = null) { _logger.LogInformation("ReadList. Name:{Name} Id:{Id}, UserId:{UserId}", model?.Name, model?.Id, model?.UserId); var list = model == null ? _diagnoseStorage.GetFullList() : _diagnoseStorage.GetFilteredList(model); if (list == null) { _logger.LogWarning("ReadList return null list"); - return null; + return new List(); } _logger.LogInformation("ReadList. Count:{Count}", list.Count); return list; diff --git a/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/IDiagnoseLogic.cs b/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/IDiagnoseLogic.cs index d931c6d..1b28ddc 100644 --- a/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/IDiagnoseLogic.cs +++ b/Polyclinic/PolyclinicContracts/BusinessLogicsContracts/IDiagnoseLogic.cs @@ -6,7 +6,7 @@ namespace PolyclinicContracts.BusinessLogicsContracts { public interface IDiagnoseLogic { - List? ReadList(DiagnoseSearchModel? model); + List ReadList(DiagnoseSearchModel? model = null); DiagnoseViewModel? ReadElement(DiagnoseSearchModel model); bool Create(DiagnoseBindingModel model); bool Update(DiagnoseBindingModel model); diff --git a/Polyclinic/PolyclinicWebAppImplementer/Controllers/DiagnosesController.cs b/Polyclinic/PolyclinicWebAppImplementer/Controllers/DiagnosesController.cs index a332252..fe0a442 100644 --- a/Polyclinic/PolyclinicWebAppImplementer/Controllers/DiagnosesController.cs +++ b/Polyclinic/PolyclinicWebAppImplementer/Controllers/DiagnosesController.cs @@ -19,7 +19,7 @@ namespace PolyclinicWebAppImplementer.Controllers [HttpGet] public IActionResult Index() { - List diagnoses = _diagnoseLogic.ReadList(null); + List diagnoses = _diagnoseLogic.ReadList(); if (diagnoses == null) { diagnoses = new();