示例#1
0
 public Models.User Create(string username, string passord, Models.UserProfile profile, DateTime? created =null)
 {
     var user = new User()
     {
         Username = username,
         Password = Crypto.HashPassword(passord),
         DateCreated = created.HasValue ? created.Value : DateTime.Now,
         Profile = profile
     };
     _users.Create(user);
     _context.SaveChanges();
     return user;
 }
示例#2
0
 public void Unfollow(string username, User follower)
 {
     _users.DeleteFollower(username, follower);
     _context.SaveChanges();
 }
示例#3
0
 public Ribbit Create(User user, string status, DateTime? created = null)
 {
     return Create(user.Id, status, created);
 }
 public void Login(User user)
 {
     _session["UserId"] = user.Id;
 }