Exemple #1
0
        public ActionResult Index()
        {
            var contacts = _contactLogic.GetAll();
            List <ContactViewModel> results = new List <ContactViewModel>();

            foreach (var item in contacts)
            {
                ContactViewModel result = new ContactViewModel()
                {
                    Id = item.Id, Address = item.Address, Content = item.Content, Email = item.Email, Name = item.Name, Title = item.Title, CreatedDate = item.CreatedDate.ToString("dd-MMM-yyyy hh:mm"), Status = item.Status
                };
                results.Add(result);
            }
            return(View(results));
        }