public async Task <IActionResult> Home(RestApiViewModel model) { var client = new RestApiService(new Uri(ConstantString.RestApiBaseURI)); var response = await client.GetRestApiResponse(JsonConvert.DeserializeObject <TransactionRequest>(model.TransationRequest)); model.TransationResponse = response; return(View(model)); }
public void RestApiViewModel_returns_pictureUrl() { RestApiViewModel test = new RestApiViewModel(); Console.WriteLine(test.GeladenesBild); Assert.IsNotNull(test.GeladenesBild, "returns picture"); }
public RestView(RestApiViewModel viewModel) { InitializeComponent(); DataContext = ViewModel = viewModel; ViewModel.Close += (sender, eventArgs) => { DialogResult = eventArgs.IsAccepted; Close(); }; }
public async Task <IActionResult> Home(string requestType) { RestApiViewModel model = new RestApiViewModel(); model.RequestType = requestType; var filePath = _hostingEnvironment.WebRootPath + @"\json\ApiRequest.json"; model.TransationRequest = requestType.GetJosnStringFromJsonFile(filePath); model.TransationResponse = string.Empty; return(View(model)); }
private void Button_BildFromApiSpeichern(object sender, RoutedEventArgs e) { var cacheVM = (NeueListeViewModel)this.DataContext; RestApiViewModel rest = new RestApiViewModel(); cacheVM.SelectedBild = rest.GeladenesBild; cacheVM.neueListe.Bild = rest.GeladenesBild; // String link = "https://i.picsum.photos/id/211/200/300.jpg"; // cacheVM.SelectedBild = link; // cacheVM.neueListe.Bild = link; this.Close(); }
public MainWindow() { InitializeComponent(); _viewModel = new RestApiViewModel(new RestApiManager(new RestApiRepository())); this.DataContext = _viewModel; }