From 77051bcf842ceb44b0b2d696c191e95359753b2e Mon Sep 17 00:00:00 2001 From: 1eG0ist Date: Sun, 17 Nov 2024 00:56:50 +0300 Subject: [PATCH] add error catching --- data/Repository/SQLGroupRepository.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/data/Repository/SQLGroupRepository.cs b/data/Repository/SQLGroupRepository.cs index b574e39..c7e2fea 100644 --- a/data/Repository/SQLGroupRepository.cs +++ b/data/Repository/SQLGroupRepository.cs @@ -28,7 +28,13 @@ namespace data.Repository public IEnumerable getAllGroup() { - return dbContext.groups.ToList(); + try + { + return dbContext.groups.ToList(); + } + catch (Exception ex) { + return new List(); + } } } }