Merge branch 'BaseLabWork07' into BaseLabWork08

This commit is contained in:
Николай 2023-04-30 13:44:44 +04:00
commit 71b12314d4
2 changed files with 5 additions and 6 deletions

View File

@ -103,11 +103,7 @@ namespace FoodOrdersBusinessLogic.BusinessLogics
{
throw new ArgumentNullException("Нет пароля клиента", nameof(model.Password));
}
if (!Regex.IsMatch(model.Email, @"^[^@\s]+@[^@\s]+\.[^@\s]+$", RegexOptions.IgnoreCase))
{
throw new ArgumentException("Неправильно введенный email", nameof(model.Email));
}
if (!Regex.IsMatch(model.Password, @"^^((\w+\d+\W+)|(\w+\W+\d+)|(\d+\w+\W+)|(\d+\W+\w+)|(\W+\w+\d+)|(\W+\d+\w+))[\w\d\W]*$", RegexOptions.IgnoreCase))
if (!Regex.IsMatch(model.Password, @"^^((\w+\d+\W+)|(\w+\W+\d+)|(\d+\w+\W+)|(\d+\W+\w+)|(\W+\w+\d+)|(\W+\d+\w+))[\w\d\W]*$", RegexOptions.IgnoreCase) && (model.Password.Length < 10 || model.Password.Length > 50))
{
throw new ArgumentException("Неправильно введенный пароль", nameof(model.Password));
}

View File

@ -26,7 +26,10 @@ namespace FoodOrdersDatabaseImplement.Models
[ForeignKey("ClientId")]
public virtual List<Order> Orders { get; set; } = new();
public static Client? Create(ClientBindingModel? model)
[ForeignKey("ClientId")]
public virtual List<MessageInfo> Messages { get; set; } = new();
public static Client? Create(ClientBindingModel? model)
{
if (model == null)
{