This commit is contained in:
parent
10d049c46b
commit
d72fa80379
@ -35,14 +35,9 @@ namespace Zurnal.Domain.UseCase
|
|||||||
{
|
{
|
||||||
UserLocalEntity userLocalEntity = new UserLocalEntity { FIO = user.FIO, GroupID = id, Guid = user.Guid };
|
UserLocalEntity userLocalEntity = new UserLocalEntity { FIO = user.FIO, GroupID = id, Guid = user.Guid };
|
||||||
UserLocalEntity? result = _repositoryUserImpl.UpdateUser(userLocalEntity);
|
UserLocalEntity? result = _repositoryUserImpl.UpdateUser(userLocalEntity);
|
||||||
if (result == null) throw new Exception("Пользователь не обновлен.");
|
if (result == null) throw new Exception("User update failed.");
|
||||||
Group? group = GetAllGroups().FirstOrDefault(it =>
|
Group? group = GetAllGroups().FirstOrDefault(it => it.Id == result.GroupID.ToString());
|
||||||
{
|
if (group == null) throw new Exception("Group not found.");
|
||||||
bool v = it.Id == result.GroupID.ToString();
|
|
||||||
return v;
|
|
||||||
});
|
|
||||||
if (group == null) throw new Exception("Группа не обновлена.");
|
|
||||||
|
|
||||||
return new User { FIO = user.FIO, Guid = user.Guid, Group = group };
|
return new User { FIO = user.FIO, Guid = user.Guid, Group = group };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user