public static Story From(this Story story, NewStoryModel @new)
        {
            story.Text = @new.Text;

            if (@new.Rank.HasValue)
                story.Rank = @new.Rank.Value;

            return story;
        }
예제 #2
0
        // GET: Home
        public ActionResult Index()
        {
            NewStoryModel newsStory = new NewStoryModel()
            {
                Headline = "Phew what a scorcher",
                ByLine   = "Ron Journo",
                Content  = "People are obsessed with the weather"
            };

            return(View(newsStory));
        }