Exemplo n.º 1
0
        public async Task UserSkillDelete(User_Skill userSkill)
        {
            try
            {
                var result = await connection.QueryAsync <int>(
                    SpName.UserSkillDelete,
                    new { userID = userSkill.UserId, skillID = userSkill.SkillId },
                    dbTransaction,
                    commandType : CommandType.StoredProcedure
                    );

                Convert.ToInt32(result.FirstOrDefault());
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        //метод сделан для работы  тестов
        public async Task <bool> IsUserSkillPresent(User_Skill userSkill)
        {
            List <User_Skill> result;

            try
            {
                result = connection.Query <User_Skill>(
                    SpName.UserSkillSelect,
                    new { userID = userSkill.UserId, skillID = userSkill.SkillId },
                    dbTransaction,
                    commandType: CommandType.StoredProcedure
                    ).ToList();
            }
            catch (SqlException ex)
            {
                throw ex;
            }

            if (result.Count == 1 && result[0].UserId == userSkill.UserId && result[0].SkillId == userSkill.SkillId)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
 [Route("user-skill/{userId}")]  //Добавить Skill пользователю
 public async Task UserSkillAdd([FromBody] User_Skill model)
 {
     await userStorage.UserSkillAdd(model);
 }