public object CheckUserName(RegisterModel model)
 {
     GenericRepository<User> userRepo = new GenericRepository<User>();
     User user = userRepo.First(u => u.Username == model.Username);
     if (user == null)
     {
         return true;
     }
     return false;
 }
        public object CheckMail(RegisterModel model)
        {
            GenericRepository<User> userRepo = new GenericRepository<User>();
            User user = userRepo.First(u => u.Email == model.Email);
            if (user == null)
            {
                return true;
            }

            return false;
        }
 public object Register(RegisterModel model)
 {
     GenericRepository<User> userRepo = new GenericRepository<User>();
     User user = new User()
     {
         Name = model.Name,
         Surname = model.Lastname,
         Email = model.Email,
         Username = model.Username,
         Password = CryptoHelper.HashPassword(model.Password),
         Gender = (model.Gender == "Female") ? true : false,
         Age = model.Age
     };
     userRepo.Add(user);
     return true;
 }