Esempio n. 1
0
        public IHttpActionResult saveFaq(Faq faqModel)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }
                if (faqModel.Id != 0)
                {
                    faqService.UpdateFaq(faqModel);
                }
                else
                {
                    faqService.CreateFaq(faqModel);
                }

                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }