Exemplo n.º 1
0
        public async Task <IActionResult> PutGroupComments(int id, DataModels.GroupComments groupComments)
        {
            if (id != groupComments.GroupCommentId)
            {
                return(BadRequest());
            }

            try
            {
                var mappaux = _mapper.Map <DataModels.GroupComments, data.GroupComments>(groupComments);
                new BS.GroupComments(_context).Update(mappaux);
            }
            catch (Exception ee)
            {
                if (!GroupCommentsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <DataModels.GroupComments> > PostGroupComments(DataModels.GroupComments groupComments)
        {
            var mappaux = _mapper.Map <DataModels.GroupComments, data.GroupComments>(groupComments);

            new BS.GroupComments(_context).Insert(mappaux);

            return(CreatedAtAction("GetGroupComments", new { id = groupComments.GroupCommentId }, groupComments));
        }