public IActionResult Run([FromBody] BuildModelDTO model) { var isLinux = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Linux); var path = isLinux ? _linuxPath : _path; var random = new Random(); const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; _name = new string(Enumerable.Repeat(chars, 8) .Select(s => s[random.Next(s.Length)]).ToArray()); _service.MakeFile(path, _name, model.Code, isLinux); if (string.IsNullOrEmpty(model.Input)) { return(Ok(_service.BuildAndRun(path, _name, isLinux, null))); } var inputs = model.Input.Split("\n"); return(Ok(_service.BuildAndRun(path, _name, isLinux, inputs))); }