コード例 #1
0
ファイル: PlansController.cs プロジェクト: zsra/Timewaster
        public async Task <IActionResult> CreateStory(StoryViewModel storyVM, int sprintId)
        {
            if (ModelState.IsValid)
            {
                Sprint sprint = await _plansService.GetSprint(new ServiceContext()
                {
                    ContextId = "TEST"
                }, storyVM.SprintId);

                Story story = storyVM.ViewModelToEntity(sprint);

                await _plansService.CreateStory(new ServiceContext()
                {
                    ContextId = "TEST"
                }, story);

                return(RedirectToAction(nameof(Index), new { id = storyVM.SprintId }));
            }
            storyVM.SprintId = sprintId;
            return(View(storyVM));
        }