From f465106840e9748fa3a479457a4ae1a41db0fc2d Mon Sep 17 00:00:00 2001 From: ArtemEmelyanov Date: Wed, 26 Apr 2023 11:58:55 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FishFactory/FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs b/FishFactory/FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs index dbf8424..2facaa4 100644 --- a/FishFactory/FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs +++ b/FishFactory/FishFactoryBusinessLogic/BusinessLogic/ClientLogic.cs @@ -111,6 +111,10 @@ namespace FishFactoryBusinessLogic.BusinessLogic { Email = model.Email, }); + if (!Regex.IsMatch(model.Email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$")) + { + throw new ArgumentException("Некорретно введенный email", nameof(model.Email)); + } if (!Regex.IsMatch(model.Password, @"^(?=.*\d)(?=.*\W)(?=.*[^\d\s]).+$")) { throw new ArgumentException("Некорректно введенный пароль. Пароль должен содержать хотя бы одну букву, цифру и не буквенный символ", nameof(model.Password));