예제 #1
0
        public async Task <IActionResult> Put(int id, PostDto postDto)
        {
            var post = _mapper.Map <Post>(postDto);

            post.Id = id;
            var result = await _postBusiness.UpdatePost(post);

            var response = new ApiResponse <bool>(result);

            return(Ok(response));
        }
예제 #2
0
        public IActionResult Maintenance(Posts entity)
        {
            entity.Publish_Date = DateTime.Now;

            if (entity.Id > 0)
            {
                _postBusiness.UpdatePost(entity);
            }
            else
            {
                _postBusiness.CreatePost(entity);
            }

            return(RedirectToAction("Post"));
        }