예제 #1
0
        public async Task <JsonResult> Add(AddArticleDto model)
        {
            var result = await _articleAppService.Add(model);

            OutputModel outputModel = new OutputModel();

            outputModel.Data = result;
            return(new JsonResult(outputModel));
        }
예제 #2
0
        public ActionResult <ArticleDto> Post([FromBody] ArticleCreateDto dto)
        {
            var article = _app.Add(dto);

            return(CreatedAtAction(nameof(Get), new { id = article.Id }, article));
        }
예제 #3
0
        public IActionResult Add(AddArticleDto dto)
        {
            var list = _articleAppService.Add(dto);

            return(RedirectToAction("Index"));
        }
예제 #4
0
 public ArticleDto Add([FromBody] AddArticleDto dto)
 {
     return(_articleAppService.Add(dto));
 }