コード例 #1
0
        public IActionResult About(string lang)
        {
            ViewBag.lang = lang;
            VMAbout model = new VMAbout()
            {
                AboutItems = _context.AboutItems.Take(3).ToList(),
                Facts      = _context.Facts.Take(4).ToList(),
                Setting    = _context.Settings.FirstOrDefault()
            };

            return(View(model));
        }
コード例 #2
0
        // GET: About
        public ActionResult Index()
        {
            VMAbout aboutmodel = new VMAbout();

            aboutmodel.BgImage     = db.BGImages.FirstOrDefault(b => b.Page == "About");
            aboutmodel.Teachers    = db.Teachers.Include("Position").OrderBy(t => t.Id).Take(4).ToList();
            aboutmodel.SocialsT    = db.SocialTeachers.ToList();
            aboutmodel.Common      = db.Commons.FirstOrDefault();
            aboutmodel.About       = db.Abouts.FirstOrDefault();
            aboutmodel.TestMorials = db.TestMorials.ToList();
            aboutmodel.TestMorial  = db.TestMorials.FirstOrDefault();
            aboutmodel.Events      = db.Events.ToList();
            return(View(aboutmodel));
        }