public IActionResult Post([FromBody] CommunityFeedback objCommunityFeedback)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    objCommunityFeedback.CreatedDate  = DateTime.Now;
                    objCommunityFeedback.ModifiedDate = DateTime.Now;
                    var id = _context.AddCommunityFeedbacks(objCommunityFeedback);
                    if (id > 0)
                    {
                        return(Ok(id));
                    }
                    else
                    {
                        return(NotFound());
                    }
                }
                catch (Exception ex)
                {
                    return(BadRequest());
                }
            }

            return(BadRequest());
        }
Пример #2
0
        public int AddCommunityFeedbacks(CommunityFeedback communityfeedback)
        {
            _pkonnectdatacontext.CommunityFeedback.Add(communityfeedback);
            int communityFeedbackId = _pkonnectdatacontext.SaveChanges();

            return(communityFeedbackId);
        }