Exemplo n.º 1
0
        public void CreateSnippet(CreateSnippet command, string userName)
        {
            var item = new SnippetModel()
            {
                Id        = command.Id,
                Name      = command.Name,
                Language  = command.Language,
                Variables = command.Variables,
                Template  = command.Template,
                Code      = command.Code,
                CreatedBy = userName
            };

            _snippetRepository.Insert(item);

            _publisher.PublishAsync(new SnippetCreated(
                                        command.Id,
                                        command.Name,
                                        command.Language,
                                        command.Variables,
                                        command.Template,
                                        command.Code,
                                        userName));
        }