private async Task SearchAsync(SearchBodyguardsParameters searchParams) { var bodyguardsCollection = await _repository.GetCollection(searchParams); var models = ItemViewModel.ConvertFromDto(bodyguardsCollection); BodyguardCollection = new ObservableCollection <ItemViewModel>(models); IsDataLoading = false; }
private async Task SearchAsync(SearchOrdersParameters searchParams) { var ordersCollection = await _repository.GetCollection(searchParams); var bodyguards = await _bodyguardsRepository.GetCollection(null); var models = ItemViewModel.ConvertFromDto(ordersCollection, bodyguards.ToDictionary(o => o.ID, o => o.LastName)); OrdersCollection = new ObservableCollection <ItemViewModel>(models); await Task.Delay(4000); IsDataLoading = false; }