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 }); }
private bool IsCurrentUserOwner(Snake snake) { return snake.OwnerId == User.Identity.GetUserId(); }
public void SaveSnake(Snake snake) { _snakesCollection.Save(snake); }