コード例 #1
0
        public bool ValidateInput(ICreateAuthor createAuthor)
        {
            if (createAuthor is null)
            {
                return(false);
            }
            if (string.IsNullOrEmpty(createAuthor.Name))
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
 public IActionResult Post([FromBody] AuthorDto dto, [FromServices] ICreateAuthor command)
 {
     _executor.ExecuteCommand(command, dto);
     return(StatusCode(StatusCodes.Status201Created));
 }