public ActionResult Edit(Board board)
 {
     if (ModelState.IsValid)
     {
         var userId = this.User.Identity.GetUserId();
         _service.Edit(board, userId);
         return RedirectToAction("Index", new { id = board.Id });
     }
     return View();
 }
 public ActionResult Create(Board board)
 {
     if (ModelState.IsValid)
     {
         var userId = this.User.Identity.GetUserId();
         board.UserId = userId;
         _service.Create(board, userId);
         return RedirectToAction("ApplicationUserView", "ApplicationUsers");
     }
     return View();
 }
        public void Create(Board board, string userId)
        {
            var originalUser = _repo.Query<ApplicationUser>()
                .Where(u => u.Id == userId)
                .Include(u => u.Boards)
                .FirstOrDefault();

            board.UserId = userId;
            originalUser.Boards.Add(board);
            _repo.SaveChanges();
        }
        public void Edit(Board board, string userId)
        {
            var original = this.Find(board.Id);

            original.BoardName = board.BoardName;
            original.Description = board.Description;
            original.ImageUrl = board.ImageUrl;

            var originalUser = _repo.Query<ApplicationUser>()
                .Where(u => u.Id == userId)
                .Include(u => u.Boards)
                .FirstOrDefault();

            _repo.SaveChanges();
        }