public Task <IDataResult <EdifactViewModal> > Question1(EdifactViewModal edifactViewModal) { var lines = edifactViewModal.Message.Split('\''); // splits at the apostrophe character foreach (string line in lines) { var pieces = line.Split('+', ':'); // splits at both of those characters //DoSomething(pieces); } return((Task <IDataResult <EdifactViewModal> >) DataResult <EdifactViewModal> .Success(edifactViewModal)); }
public async Task <IActionResult> Question1( [FromServices] ICodeChallengeAppService _repository, [FromBody] EdifactViewModal edifactViewModal ) { try { return(new OkObjectResult(await _repository.Question1(edifactViewModal))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }