public void Update(User entity)
 {
     if (entity != null)
     {
         uow.UserRepository.Update(entity.ToDalUser());
         uow.SaveChanges();
     }
 }
        public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
        {
            MembershipUser user = GetUser(username, false);

            if (user == null)
            {
                User newUser = new User()
                {
                    PasswordHash = Crypto.HashPassword(password),
                    CreationDate = DateTime.Now,
                    Email = username,
                    Roles = new List<Role>() { new Role() { Name = "user" } }
                };

                //IKernel kernel = new StandardKernel(new BindingModule());
                //IUserService userService = kernel.Get<IUserService>();

                IUserService userService = DependencyResolver.Current.GetService<IUserService>();

                userService.Create(newUser);

                status = MembershipCreateStatus.Success;

                return new MembershipUser("CommonMembershipProvider", newUser.Email, newUser.Id, newUser.Email,
                null, null, true, false, newUser.CreationDate, DateTime.MinValue,
                DateTime.MinValue, DateTime.MinValue, DateTime.MinValue);
            }
            else
            {
                status = MembershipCreateStatus.DuplicateUserName;
                return null;
            }
            
        }
 public void Create(User entity)
 {
     uow.UserRepository.Create(entity.ToDalUser());
     uow.SaveChanges();
 }