public void Initialize()
        {
            efStorage = new EfStorage(new EfStorageDbInitializerTest());
            efStorage.Database.Initialize(true);

            repository = new UserRepository();

            userEntity = new UserEntity()
            {
                Id = Guid.NewGuid(),
                Name = "Foo",
                Email = "*****@*****.**",
                HashedPassword = "******",
            };
        }
        private UserEntity ToUserEntity()
        {
            var password = new Password(Password);

            var userEntity = new UserEntity
            {
                Name = Name,
                Email = Email,
                IsConfirmed = false,
                Id = Id,
                Salt = password.GetSalt(),
                HashedPassword = password.GetHashed(),
            };

            userEntity.Roles.Add(new RoleRepository().GetRole(Role.Regular));

            return userEntity;
        }
 private void FromEntity(UserEntity userEntity)
 {
     Id = userEntity.Id;
     Name = userEntity.Name;
     Email = userEntity.Email;
     BusinessTrips = userEntity.BusinessTrips.ToList().Select(e => new BusinessTripModel(e));
 }
 public UserModel(UserEntity userEntity)
 {
     FromEntity(userEntity);
 }
 public void Add(UserEntity userEntity)
 {
     storage.Add(userEntity);
 }