public async Task <IActionResult> Delete(List <IFormFile> files) { List <ValidationResult> validationsResults = new List <ValidationResult>(); foreach (var file in files) { var arrayFile = OFXUtils.ReadAsArray(file); var result = OFXUtils.ReadOFXtoXMLFromArray(arrayFile); var ofx = OFX.GetOFXFromString(result); ofx.Id = ofx.GenerateOFXId(); validationsResults.Add(await _OFXAppService.Remove(ofx.Id)); } return(!ModelState.IsValid ? CustomResponse(ModelState) : CustomResponse(validationsResults)); }
public async Task <IActionResult> Put(List <IFormFile> files) { List <ValidationResult> validationsResults = new List <ValidationResult>(); foreach (var file in files) { var arrayFile = OFXUtils.ReadAsArray(file); var result = OFXUtils.ReadOFXtoXMLFromArray(arrayFile); var ofx = OFX.GetOFXFromString(result); ofx.FileOFX = string.Join('\n', result); var ofxViewModel = new OFXViewModel { OFX = ofx }; validationsResults.Add(await _OFXAppService.Update(ofxViewModel)); } return(!ModelState.IsValid ? CustomResponse(ModelState) : CustomResponse(validationsResults)); }
public void TestReadXML() { var input = OFXUtils.ReadOFXtoXMLFromPath(@"D:\Rubens\Desktop\DevelopersChallenge2-master\DevelopersChallenge2-master\OFX\extrato1.ofx"); var ofx = OFX.GetOFXFromString(input); }