Exemple #1
0
        public ActionResult Create()
        {
            Account account  = new Account();
            var     contacts = _contactQueries.GetAll();

            account.Contacts = contacts;
            var viewModel = _mapperForAccount.MapToAccountCreateViewModel(account);

            return(View(viewModel));
        }
Exemple #2
0
        // GET: Contact
        public ActionResult Index()
        {
            var contact   = _contactQueries.GetAll();
            var viewModel = _mapperForContact.MapToContactViewModel(contact);

            return(View(viewModel));
        }
 public ContactsCollection Get()
 {
     return(Collection(_contactsQueries.GetAll().ProjectTo <ContactResource>()));
 }
Exemple #4
0
 protected override async Task <IReadOnlyList <EditableContact> > LoadAsync()
 {
     return(await Task.Run(() => _contactQueries.GetAll().Select(a => new EditableContact(a)).ToList()));
 }