コード例 #1
0
        public async Task <IActionResult> Post([FromBody] FileRequest request, [FromServices] IUploadFileCommandAsync command)
        {
            if (!System.IO.File.Exists(request.Path))
            {
                return(BadRequest(new
                {
                    message = "Please provide a valid file path!"
                }));
            }
            await _executor.ExecuteCommandAsync(command, request);

            return(Ok("File uploaded"));
        }
コード例 #2
0
ファイル: Project.cs プロジェクト: dzondraa/ProjectManager
        public async Task <IActionResult> Post([FromBody] ProjectRequest dto, [FromServices] ICreateProjectCommandAsync command)
        {
            await _executor.ExecuteCommandAsync(command, dto);

            return(Ok());
        }
コード例 #3
0
        public async Task <IActionResult> Post([FromBody] TaskRequest request, [FromServices] ICreateTaskCommandAsync command)
        {
            await _executor.ExecuteCommandAsync(command, request);

            return(Ok());
        }