Esempio n. 1
0
        public async Task <IActionResult> Create(Post post)
        {
            try
            {
                await _postBusiness.CreatePost(post);

                return(Ok());
            }
            catch (ArgumentException e)
            {
                return(BadRequest(e.Message));
            }
        }
Esempio n. 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"));
        }