Beispiel #1
0
        public async Task CreateScriptForUser(string userName, string scriptName, string scriptBody, SupportedLanguage language)
        {
            var newScript = new User.AddScriptCommand(userName, scriptName, scriptBody, language);

            using (var context = NewContext())
            {
                var user = await context.Users.FindAsync(userName);

                await user.AddAsync(newScript, context);
            }
        }
Beispiel #2
0
        public async Task <IActionResult> AddUserScript(User.AddScriptCommand command)
        {
            var result = await Facade.ExecuteCommandAsync(command);

            return(CreatedAtRoute(nameof(GetScript), result.Id, result));
        }