Guest User

Untitled

a guest
Jun 18th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public OverviewVM(IRepository<ToDoItem> toDoRepo)
  2. {
  3. _toDoRepo = toDoRepo ?? throw new ArgumentNullException("toDoRepo");
  4. IsFaulted = false;
  5. ErrorMessage = string.Empty;
  6. }
  7.  
  8. public async Task LoadData()
  9. {
  10. try
  11. {
  12. ToDoItems = await _toDoRepo.GetAsync();
  13. IsFaulted = false;
  14. ErrorMessage = string.Empty;
  15. }
  16. catch (Exception)
  17. {
  18. IsFaulted = true;
  19. ErrorMessage = "Unable to Load ToDo Items";
  20. }
  21. }
Add Comment
Please, Sign In to add comment