示例#1
0
 public ActionResult Add()
 {
     if (User == null)
     {
         return RedirectToAction("Index");
     }
     var snake = new Snake(User.Identity.GetUserId());
     snakeStore.SaveSnake(snake);
     return RedirectToAction("Edit", new { id = snake.Id });
 }
示例#2
0
 private bool IsCurrentUserOwner(Snake snake)
 {
     return snake.OwnerId == User.Identity.GetUserId();
 }
示例#3
0
 public void SaveSnake(Snake snake)
 {
     _snakesCollection.Save(snake);
 }