/// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="entity"></param>
        /// <returns></returns>
        public MentorSquad Alterar(int id, MentorSquad entity)
        {
            entity.ID = id;
            _mentorSquadRepositorio.Alterar(entity);

            return(_mentorSquadRepositorio.SelecionarPorId(id));
        }
 /// <summary>
 /// ALTERA ASSOCIAÇÃO MENTOR_SQUAD
 /// </summary>
 /// <param name="entity"></param>
 public void Alterar(MentorSquad entity)
 {
     using (var connection = new SqlConnection(DbConnection.GetConn()))
     {
         connection.Execute($"UPDATE [TB_MENTOR_SQUAD] " +
                            $"SET IdSquad = {entity.IdSquad}, " +
                            $"IdMentor = {entity.IdUser} " +
                            $"WHERE ID = {entity.ID}");
     }
 }
Esempio n. 3
0
        public IActionResult PutPapel([FromRoute] int id, [FromBody] MentorSquadInput input)
        {
            var objMentorSquad = new MentorSquad()
            {
                IdSquad = input.IdSquad,
                IdUser  = input.IdUser
            };

            var obj = _mentorSquadNegocio.Alterar(id, objMentorSquad);

            return(Accepted(obj));
        }