public IHttpActionResult ProvideScript(ScriptRequestViewModel request)
        {
            var script = new ScriptRepository().ProvideScript(request);
            var response = new ScriptResponse()
            {
                Text = script.Text
            };

            return Ok(script);
        }
 public IHttpActionResult Save(Script script)
 {
     if(ModelState.IsValid)
     {
         var result = new ScriptRepository().SaveScript(script);
         return Ok(result);
     }
     return new System.Web.Http.Results.ExceptionResult(new System.Exception(), this);
 }
        public IHttpActionResult ProvideScriptsForAScreen(ScriptRequestViewModel request)
        {
            var scripts = new ScriptRepository().ProvideScriptsForAScreen(request);

            return Ok(scripts);
        }
 public IHttpActionResult Get(int scriptId)
 {
     var repository = new ScriptRepository();
     var script = repository.ScriptById(scriptId);
     return Ok(script);
 }
 public IEnumerable<Script> Get()
 {
     var repository = new ScriptRepository();
     return repository.GetAllScriptsWithFields();
 }