public async Task <SVCResultViewModel> Migrate(SVCMigrationOperationViewModel model) { SVCResultViewModel result = new SVCResultViewModel(Constants.MSG_RESULT_MESSAGE_OK, Constants.MSG_RESULT_STATUS_OK, Constants.MSG_RESULT_CODE_OK); _logger.LogInformation(string.Format("-- ApiManager - Create started")); string jsonMessage = ""; try { // Read token from ServerLogin string token = await _authentication.GetToken(); using (var client = new HttpClient()) { client.BaseAddress = new Uri(Constants.BASE_ADDRESS); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); //Read endpoint from CampaignType string endpoint = Constants.API_MIGRATE; HttpResponseMessage response = await client.PutAsync(endpoint, new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json")); using (Stream responseStream = await response.Content.ReadAsStreamAsync()) { jsonMessage = new StreamReader(responseStream).ReadToEnd(); } result = JsonConvert.DeserializeObject <SVCResultViewModel>(jsonMessage); } } catch (System.Exception ex) { result.ResultMessage = ex.Message; result.ResultStatus = Constants.MSG_RESULT_STATUS_NOK; result.ResultCode = Constants.MSG_RESULT_CODE_KO; } return(result); }
public IActionResult Migrate(SVCResultViewModel card) { return(View()); }
public IActionResult AssociaCarta(SVCResultViewModel model) { ViewBag["Titolo"] = "Associa Carta"; return(View()); }