From f247d9defc1fc76fb3a35cdd2652b3680529a4bd Mon Sep 17 00:00:00 2001 From: Yunusov_Niyaz Date: Mon, 27 May 2024 01:10:29 +0400 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B5=D0=B3=D1=83=D0=BB=D1=8F=D1=80?= =?UTF-8?q?=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VeterinaryBusinessLogic/BusinessLogic/OwnerLogic.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VeterinaryView/VeterinaryBusinessLogic/BusinessLogic/OwnerLogic.cs b/VeterinaryView/VeterinaryBusinessLogic/BusinessLogic/OwnerLogic.cs index 31f8617..c2e8390 100644 --- a/VeterinaryView/VeterinaryBusinessLogic/BusinessLogic/OwnerLogic.cs +++ b/VeterinaryView/VeterinaryBusinessLogic/BusinessLogic/OwnerLogic.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Logging; +using System.Text.RegularExpressions; using VeterinaryContracts.BindingModels; using VeterinaryContracts.BusinessLogicContracts; using VeterinaryContracts.SearchModels; @@ -95,6 +96,10 @@ namespace VeterinaryBusinessLogic.BusinessLogic throw new ArgumentNullException("Нет Login клиента", nameof(model.Login)); } + if (!Regex.IsMatch(model.Login, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$")) + { + throw new ArgumentException("Некорретно введен email клиента", nameof(model.Login)); + } if (string.IsNullOrEmpty(model.Password)) { throw new ArgumentNullException("Нет пароля клиента",