ClientStorage fix

This commit is contained in:
DavidMakarov 2024-05-30 06:55:53 +04:00
parent 6ab2e20a46
commit c022d1a1cc

View File

@ -3,6 +3,7 @@ using FactoryContracts.SearchModels;
using FactoryContracts.StoragesContracts;
using FactoryContracts.ViewModels;
using FactoryDatabaseImplement.Models;
using FactoryDataModels.Enums;
namespace FactoryDatabaseImplement.Implements
{
@ -37,7 +38,7 @@ namespace FactoryDatabaseImplement.Implements
}
using var context = new FactoryDatabase();
return context.Clients
.FirstOrDefault(x => ((!string.IsNullOrEmpty(model.Login) && x.Login == model.Login) && (!string.IsNullOrEmpty(model.Password) && x.Password == model.Password)) ||
.FirstOrDefault(x => ((!string.IsNullOrEmpty(model.Login) && x.Login == model.Login) && (!string.IsNullOrEmpty(model.Password) && x.Password == model.Password) && model.Role != ClientRole.Неизвестен && model.Role == x.Role) ||
(model.Id.HasValue && x.Id == model.Id))
?.GetViewModel;
}