Example #1
0
        public IActionResult Index()
        {
            var contacts = _contactDatabase.GetContacts()
                           .Select(item => new ContactIndexModel()
            {
                Id        = item.Id,
                FirstName = item.FirstName,
                LastName  = item.LastName,
            });

            return(View(contacts));
        }
Example #2
0
        public IActionResult Index()
        {
            var contacts = _contactDatabase.GetContacts().Select(x => new ContactListViewModel
            {
                Id      = x.Id,
                Name    = x.Name,
                Surname = x.Surname,
                Telnr   = x.TelNr
            });


            return(View(contacts));
        }
Example #3
0
        public IActionResult Contactenoverzicht()
        {
            IEnumerable <Contact>       contactsFromDb = _contactDatabase.GetContacts();
            List <ContactListViewModel> contacts       = new List <ContactListViewModel>();

            foreach (var contact in contactsFromDb)
            {
                contacts.Add(new ContactListViewModel()
                {
                    Id = contact.Id, Geslacht = contact.Geslacht, Naam = contact.Naam, Voornaam = contact.Voornaam
                });
            }

            return(View(contacts));
        }
Example #4
0
        public IActionResult Index()
        {
            List <ContactListViewModel> contacts             = new List <ContactListViewModel>();
            IEnumerable <Contact>       contactsFromDatabase = _contactDabase.GetContacts();

            foreach (var contact in contactsFromDatabase)
            {
                contacts.Add(new ContactListViewModel()
                {
                    Id   = contact.Id,
                    Naam = contact.Voornaam + " " + contact.Naam
                });
            }


            return(View(contacts));
        }