public HttpResponseMessage UploadBlogPhoto(BlogPhotoAddRequest model)
        {
            ItemResponse <int> response = new ItemResponse <int>();

            response.Item = _uploadService.InsertBlogPhoto(model);
            return(Request.CreateResponse(HttpStatusCode.OK, response));
        }
        public int InsertBlogPhoto(BlogPhotoAddRequest model)
        {
            int id = 0;

            DataProvider.ExecuteNonQuery(GetConnection, "dbo.Blog_InsertPhotoKey",
                                         inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@PhotoKey", model.BlogPhotoKey);
                paramCollection.AddWithValue("@BlogId", model.BlogId);
                SqlParameter p = new SqlParameter("@Id", SqlDbType.Int);
                p.Direction    = ParameterDirection.Output;
                paramCollection.Add(p);
            }, returnParameters : delegate(SqlParameterCollection param)
            {
                Int32.TryParse(param["@Id"].Value.ToString(), out id);
            }
                                         );
            return(id);
        }