public Int32 Add(SiteLinksAddRequest model, string userId)
        {
            Int32 id = 0;

            DataProvider.ExecuteNonQuery(GetConnection, "dbo.SiteLinks_Insert"
               , inputParamMapper: delegate (SqlParameterCollection paramCollection)
               {
                   paramCollection.AddWithValue("@Url", model.Url);
                   paramCollection.AddWithValue("@Type", model.Type);
                   paramCollection.AddWithValue("@Group", model.Group);
                   paramCollection.AddWithValue("@OwnerId", model.OwnerId);
                   paramCollection.AddWithValue("@OwnerType", model.OwnerType);
                   paramCollection.AddWithValue("@Userid", userId);

                   SqlParameter s = new SqlParameter("@Id", System.Data.SqlDbType.Int);
                   s.Direction = System.Data.ParameterDirection.Output;

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

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

            string userId = _userService.GetCurrentUserId();
            ItemResponse<Int32> response = new ItemResponse<Int32>();

            response.Item = _siteLinksService.Add(model, userId);

            return Request.CreateResponse(response);
        }