Ejemplo n.º 1
0
 public IEnumerable <TeacherModel> Get()
 {
     return(_teachersService.All().Select(x => new TeacherModel
     {
         Id = x.Id,
         Name = x.Name,
     }).ToList());
 }
Ejemplo n.º 2
0
        // GET: Admin/Teachers
        public ActionResult Index()
        {
            ViewBag.Breadcrumb = new List <Breadcrumb>()
            {
                new Breadcrumb(Breadcrumb.HomeName, Breadcrumb.AdminHomeUrl),
                new Breadcrumb(Breadcrumb.TeachersName)
            };

            var model = teachersService
                        .All()
                        .ProjectTo <TeacherViewModel>()
                        .ToList();

            return(View(model));
        }