public async Task GetContacts(IGetContactsCallback callback, ContactsQueryParameters queryParams) { try { ContactList response = await _api.GetContacts(queryParams); ContactListViewModel contactList = new ContactListViewModel(response); callback.OnContactsLoaded(contactList); } catch (ApiException e) { if (e.StatusCode == HttpStatusCode.NotFound) { callback.OnContactsLoaded(new ContactListViewModel( )); } else { callback.OnDataNotAvailable( ); } } }
public async Task GetContacts(IGetContactsCallback callback, ContactsQueryParameters queryParams) { await _contactsApiDataSource.GetContacts(callback, queryParams); }
public ContactsPresenter(IContactsDataSource contactsRepository, IContactsView contactsView, IGetContactsCallback contactsViewCallback) : base(contactsView) { _contactsRepository = contactsRepository; _contactsViewCallback = contactsViewCallback; }