public Task <List <ValidationResult> > ValidateFull() { var moq = new AdquirenciaInfo(); var moqValues = moq.GetCollection(); var service = new KomerciWcfClient(); var result = new List <ValidationResult>(); return(Task.Run(() => { Parallel.ForEach(moqValues, x => { var r = CallGetAuthorizedCreditAsync(service, x); result.Add(r); }); return result; })); }
private ValidationResult CallGetAuthorizedCreditAsync(KomerciWcfClient service, AdquirenciaInfo item) { var validationResult = new ValidationResult(); var msg = string.Empty; item.Request.NumPedido = "ValidSyon-" + Guid.NewGuid().ToString().Substring(0, 5); var wsResult = service.GetAuthorizedCreditAsync(item.Request); wsResult.Wait(); validationResult.TimeFinish = DateTime.Now; validationResult.IsPass = item.EqualsResult(wsResult.Result, out msg); validationResult.Message = msg; validationResult.Order = item.Request.NumPedido; return(validationResult); }
public IActionResult Index() { var service = new KomerciWcfClient(); return(View()); }