Измененена сигнатура функции получения списка для логики курсов и симптомов

This commit is contained in:
Никита Потапов 2024-05-26 11:33:55 +04:00
parent 05109f7b3f
commit 2047774700
4 changed files with 6 additions and 6 deletions

View File

@ -58,14 +58,14 @@ namespace PolyclinicBusinessLogic.BusinessLogics
return element; return element;
} }
public List<CourseViewModel>? ReadList(CourseSearchModel? model) public List<CourseViewModel> ReadList(CourseSearchModel? model = null)
{ {
_logger.LogInformation("ReadList. Id:{Id}", model?.Id); _logger.LogInformation("ReadList. Id:{Id}", model?.Id);
var list = model == null ? _courseStorage.GetFullList() : _courseStorage.GetFilteredList(model); var list = model == null ? _courseStorage.GetFullList() : _courseStorage.GetFilteredList(model);
if (list == null) if (list == null)
{ {
_logger.LogWarning("ReadList return null list"); _logger.LogWarning("ReadList return null list");
return null; return new List<CourseViewModel>();
} }
_logger.LogInformation("ReadList. Count:{Count}", list.Count); _logger.LogInformation("ReadList. Count:{Count}", list.Count);
return list; return list;

View File

@ -58,14 +58,14 @@ namespace PolyclinicBusinessLogic.BusinessLogics
return element; return element;
} }
public List<SymptomViewModel>? ReadList(SymptomSearchModel? model) public List<SymptomViewModel> ReadList(SymptomSearchModel? model = null)
{ {
_logger.LogInformation("ReadList. Name:{Name} Id:{Id}", model?.Name, model?.Id); _logger.LogInformation("ReadList. Name:{Name} Id:{Id}", model?.Name, model?.Id);
var list = model == null ? _symptomStorage.GetFullList() : _symptomStorage.GetFilteredList(model); var list = model == null ? _symptomStorage.GetFullList() : _symptomStorage.GetFilteredList(model);
if (list == null) if (list == null)
{ {
_logger.LogWarning("ReadList return null list"); _logger.LogWarning("ReadList return null list");
return null; return new List<SymptomViewModel>();
} }
_logger.LogInformation("ReadList. Count:{Count}", list.Count); _logger.LogInformation("ReadList. Count:{Count}", list.Count);
return list; return list;

View File

@ -6,7 +6,7 @@ namespace PolyclinicContracts.BusinessLogicsContracts
{ {
public interface ICourseLogic public interface ICourseLogic
{ {
List<CourseViewModel>? ReadList(CourseSearchModel? model); List<CourseViewModel> ReadList(CourseSearchModel? model = null);
CourseViewModel? ReadElement(CourseSearchModel model); CourseViewModel? ReadElement(CourseSearchModel model);
bool Create(CourseBindingModel model); bool Create(CourseBindingModel model);
bool Update(CourseBindingModel model); bool Update(CourseBindingModel model);

View File

@ -6,7 +6,7 @@ namespace PolyclinicContracts.BusinessLogicsContracts
{ {
public interface ISymptomLogic public interface ISymptomLogic
{ {
List<SymptomViewModel>? ReadList(SymptomSearchModel? model); List<SymptomViewModel> ReadList(SymptomSearchModel? model = null);
SymptomViewModel? ReadElement(SymptomSearchModel model); SymptomViewModel? ReadElement(SymptomSearchModel model);
bool Create(SymptomBindingModel model); bool Create(SymptomBindingModel model);
bool Update(SymptomBindingModel model); bool Update(SymptomBindingModel model);