ChessSharp.Web.Controllers.ChallengeController.Make C# (CSharp) Method

Make() private method

private Make ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult
        public ActionResult Make()
        {
            var playersToChallenge = UnitOfWork.All<ChessUser>(p => p.Id != CurrentUser.Id);

            var currentChallenges =
                UnitOfWork.All<Challenge>(c => c.ChallengingPlayer.Id == CurrentUser.Id);

            var model = new CreateChallengeViewModel
            {
                Players = playersToChallenge.Select(AutoMapper.Mapper.Map<PlayerViewModel>).ToList(),
                CurrentChallenges = currentChallenges.Select(c => new ChallengeViewModel
                {
                    Accepted = c.Accepted.HasValue && c.Accepted.Value,
                    ChallengerId = c.ChallengingPlayer.Id,
                    ChallengeTitle = c.Title,
                    DarkPlayerId = c.DarkPlayer.Id,
                    LightPlayerId = c.LightPlayer.Id

                }).ToList()
            };

            return View(model);
        }

Same methods

ChallengeController::Make ( CreateChallengeViewModel model ) : System.Web.Mvc.ActionResult