регулярка
This commit is contained in:
parent
a250011ae9
commit
f247d9defc
@ -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("Нет пароля клиента",
|
||||
|
Loading…
Reference in New Issue
Block a user