Esempio n. 1
0
        //1. Version ohne View
        //public HtmlContentViewComponentResult Invoke()
        //{
        //    return new HtmlContentViewComponentResult(new HtmlString("Das ist eine <h3>ViewComponente</h3>"));
        //}

        //2. Version mit View
        public IViewComponentResult Invoke()
        {
            var autoren      = _autorRepository.GetAll().ToList();
            var sdtSummaryVm = new SdtSummaryViewModel
            {
                AnzahlAutoren  = autoren.Count,
                AnzahlSprueche = autoren.Sum(c => c.Sprueche.Count)
            };

            //return View(sdtSummaryVm);
            return(View("Alternative", sdtSummaryVm));
        }
        public IEnumerable <SelectListItem> GetAllAutor()
        {
            var listaAutoresSelect = new List <SelectListItem>();

            _autorRepository.GetAll().ForEach(item => listaAutoresSelect
                                              .Add(new SelectListItem
            {
                Value = item.AutorId.ToString(),
                Text  = item.Nome
            }));

            return(listaAutoresSelect);
        }
Esempio n. 3
0
 public IList <Autor> GetAllAutor()
 {
     return(_AutorRepository.GetAll());
 }
Esempio n. 4
0
 public IEnumerable <AutorModel> GetAll()
 {
     return(_autorRepository.GetAll());
 }
Esempio n. 5
0
 public IEnumerable <Autor> ListarAutores()
 {
     return(_autorRepository.GetAll());
 }
Esempio n. 6
0
 // GET: Autor
 public ActionResult Index()
 {
     return(View(_repository.GetAll()));
 }
Esempio n. 7
0
 public IEnumerable <dynamic> GetAll()
 {
     return(_autorRepository.GetAll());
 }
Esempio n. 8
0
        public ActionResult Index()
        {
            var autores = repository.GetAll();

            return(View(autores));
        }