Микрофикс
This commit is contained in:
parent
dfbf69b305
commit
baccac7171
@ -42,23 +42,19 @@ namespace ShipyardDataBaseImplement.Implements
|
|||||||
if (model.Id.HasValue)
|
if (model.Id.HasValue)
|
||||||
{
|
{
|
||||||
return context.Clients
|
return context.Clients
|
||||||
.FirstOrDefault(x => x.Id == model.Id)?
|
.FirstOrDefault(x => (x.Id == model.Id))?.GetViewModel;
|
||||||
.GetViewModel;
|
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(model.Email) && !string.IsNullOrEmpty(model.Password))
|
else if (!string.IsNullOrEmpty(model.Email) && !string.IsNullOrEmpty(model.Password))
|
||||||
{
|
{
|
||||||
return context.Clients
|
return context.Clients
|
||||||
.FirstOrDefault(x => x.Email
|
.FirstOrDefault(x => (x.Email == model.Email && x.Password == model.Password))?.GetViewModel;
|
||||||
.Equals(model.Email) && x.Password
|
|
||||||
.Equals(model.Password))?
|
|
||||||
.GetViewModel;
|
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(model.Email))
|
else if (!string.IsNullOrEmpty(model.Email))
|
||||||
{
|
{
|
||||||
return context.Clients
|
return context.Clients
|
||||||
.FirstOrDefault(x => x.Email.Equals(model.Email))?.GetViewModel;
|
.FirstOrDefault(x => (x.Email == model.Email))?.GetViewModel;
|
||||||
}
|
}
|
||||||
return null;
|
return new();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientViewModel? Insert(ClientBindingModel model)
|
public ClientViewModel? Insert(ClientBindingModel model)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user