示例#1
0
        public async Task <IActionResult> AddScript(ScriptBindingModel scriptBindingModel)
        {
            var result   = new Response <BaseDto>();
            var username = HttpContext.User.Claims.First(c => c.Type == ClaimTypes.GivenName).Value;

            result = await _scriptService.AddAsync(scriptBindingModel, username);

            if (result.ErrorOccured)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }