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()); }
public int AddCommunityFeedbacks(CommunityFeedback communityfeedback) { _pkonnectdatacontext.CommunityFeedback.Add(communityfeedback); int communityFeedbackId = _pkonnectdatacontext.SaveChanges(); return(communityFeedbackId); }