예제 #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);
 }
예제 #4
0
 public void Login(User user)
 {
     _session["UserId"] = user.Id;
 }