コード例 #1
0
        public static TermYearViewModel MapTermYearViewModel(TermYear termYear)
        {
            var model = new TermYearViewModel
            {
                id     = termYear.Id,
                active = termYear.Active,
                title  = termYear.Title,
                year   = termYear.Year
            };

            return(model);
        }
コード例 #2
0
        public IActionResult Create()
        {
            var activeTermYear = termService.GetActiveTermYear();

            var termYear = new TermYearViewModel {
                year = activeTermYear.Year + 1
            };
            var model = new TermYearEditForm {
                year = termYear
            };

            return(Ok(model));
        }