public async Task <IActionResult> PutGroupComment(int id, DataModels.GroupComment groupComment) { if (id != groupComment.GroupCommentId) { return(BadRequest()); } var mapaux = _mapper.Map <DataModels.GroupComment, data.GroupComment>(groupComment); try { new BS.GroupComment(_context).Update(mapaux); } catch (Exception ee) { if (!GroupCommentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <DataModels.GroupComment> > PostGroupComment(DataModels.GroupComment groupComment) { var mapaux = _mapper.Map <DataModels.GroupComment, data.GroupComment>(groupComment); new BS.GroupComment(_context).Insert(mapaux); return(CreatedAtAction("GetGroupComment", new { id = groupComment.GroupCommentId }, groupComment)); }