예제 #1
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            投稿  post   = 投稿.新規("●●について", "まるまるまる");
            投稿者 author = 投稿者.新規作成("○○さん");

            return(View(PostViewModel.Create(post, author)));
        }
예제 #2
0
        public static PostViewModel Create(投稿 post, 投稿者 author)
        {
            if (post == null)
            {
                throw new ArgumentNullException(nameof(post));
            }

            if (author == null)
            {
                throw new ArgumentNullException(nameof(author));
            }

            return(new PostViewModel()
            {
                Title = post.タイトルを見る(),
                Content = post.内容を見る(),
                Author = author.前を見る()
            });
        }