Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GitHubTagger"/> class.
        /// </summary>
        /// <param name="createCommand">
        /// The command for creating a tag.
        /// </param>
        /// <param name="logger">
        /// The task logger.
        /// </param>
        public GitHubTagger(ICreateTagCommand createCommand, ITaskLogger logger)
        {
            if (createCommand == null)
                throw new ArgumentNullException("createCommand");

            if (logger == null)
                throw new ArgumentNullException("logger");

            this.createCommand = createCommand;
            this.logger = logger;
        }
 public IActionResult Post([FromBody] AddTag dto, [FromServices] ICreateTagCommand command)
 {
     try
     {
         executor.ExecuteCommand(command, dto);
         return(StatusCode(202, "Sucessfully added new tag."));
     }
     catch
     {
         return(StatusCode(422, "Error has been acured!"));
     }
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GitHubTagger"/> class.
        /// </summary>
        /// <param name="createCommand">
        /// The command for creating a tag.
        /// </param>
        /// <param name="logger">
        /// The task logger.
        /// </param>
        public GitHubTagger(ICreateTagCommand createCommand, ITaskLogger logger)
        {
            if (createCommand == null)
            {
                throw new ArgumentNullException("createCommand");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            this.createCommand = createCommand;
            this.logger        = logger;
        }
Example #4
0
 public IActionResult Post([FromBody] TagDto dto, [FromServices] ICreateTagCommand command)
 {
     _executor.ExecuteCommand(command, dto);
     return(StatusCode(StatusCodes.Status201Created));
 }