protected virtual UserStorageModel GetBot(int userTypeId)
        {
            var botUser = new UserStorageModel
            {
                Name = "АвтоРассылка",
                UserTypeId = userTypeId,
            };

            return botUser;
        }
        public HospitalStorageModel GetHospitalByUser(UserStorageModel model)
        {
            var hospitals = hospitalRepository.GetModels();

            var result =
                hospitals.FirstOrDefault(
                    storageModel =>
                        storageModel.HospitalUsers.Select(userStorageModel => userStorageModel.Id).Contains(model.Id));

            return result;
        }
        public ClinicStorageModel GetClinicByUser(UserStorageModel model)
        {
            var clinicUser = ((IDbSet<ClinicUserStorageModel>) _clinicUserRepository.GetModels())
                .Include(storageModel => storageModel.Clinic)
                .FirstOrDefault(storageModel => storageModel.Id == model.Id);

            if (clinicUser == null)
            {
                return null;
            }

            return clinicUser.Clinic;
        }
        protected virtual UserStorageModel GetAdmin(int userTypeId)
        {
            var adminUser = new UserStorageModel
            {
                Name = AdminLogin,
                UserTypeId = userTypeId,
                Account = new AccountStorageModel
                {
                    HashedPassword = _passwordHashManager.GetPasswordHash(AdminPassword),
                    IsBlocked = false,
                    Login = AdminLogin,
                }
            };

            return adminUser;
        }
        protected virtual IEnumerable<UserFunctionStorageModel> GetUserFunctionsByUser(UserStorageModel user)
        {
            var result = _userFunctionRepository.GetModels()
                .Where(model => model.UserId == user.Id)
                .Where(model => !model.IsBlocked)
                .ToList();

            return result;
        }