public int AddTopic(TopicAddRequest model, string userId)
        {
            int id = 0;

            DataProvider.ExecuteNonQuery(GetConnection, "dbo.ForumTopics_Insert"
               , inputParamMapper: delegate(SqlParameterCollection paramCollection)
               {
                   paramCollection.AddWithValue("@Name", model.Name);
                   paramCollection.AddWithValue("@DateAdded", model.DateAdded);
                   //paramCollection.AddWithValue("@DateModified", model.DateModified);
                   //paramCollection.AddWithValue("@LanguageCode", model.LanguageCode);
                   paramCollection.AddWithValue("@UserId", userId);
                   paramCollection.AddWithValue("@SortOrder", 0);
                   SqlParameter p = new SqlParameter("@Id", System.Data.SqlDbType.Int);
                   p.Direction = System.Data.ParameterDirection.Output;

                   paramCollection.Add(p);

               }

               , returnParameters: delegate(SqlParameterCollection param)
               {
                   int.TryParse(param["@Id"].Value.ToString(), out id);
               }
               );

            return id;
        }
        public HttpResponseMessage AddTopic(TopicAddRequest model)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            string userId = _userService.GetCurrentUserId();

            ////Check if admin code

            //bool userIsAdmin = false;
            //IdentityUser currentUser = _userService.GetCurrentUser();
            //if (currentUser != null)
            //{
            //    List<IdentityUserRole> roles = currentUser.Roles.ToList();
            //    foreach (var role in roles)
            //    {
            //        if (role.RoleId == _superAdmin || role.RoleId == _admin)
            //        {

            //            userIsAdmin = true;
            //            break;
            //        }
            //    }

            //}

            //_userService.GetCurrentUser();

            SuccessResponse response = new SuccessResponse();

            _forumService.AddTopic(model, userId);

            return Request.CreateResponse(HttpStatusCode.OK, response);
        }