public bool ValidateInput(ICreateAuthor createAuthor) { if (createAuthor is null) { return(false); } if (string.IsNullOrEmpty(createAuthor.Name)) { return(false); } return(true); }
public IActionResult Post([FromBody] AuthorDto dto, [FromServices] ICreateAuthor command) { _executor.ExecuteCommand(command, dto); return(StatusCode(StatusCodes.Status201Created)); }