コード例 #1
0
        /// <summary>
        /// 删除收藏
        /// </summary>
        /// <param name="entity">收藏</param>
        public HttpResponseMessage Delete([FromBody]Collection entity)
        {
            if (entity == null)
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
            else
            {
                CollectionFunction collectionFunction = new CollectionFunction();
                int error = collectionFunction.DeleteCollection(entity);
                var response = GetResponse.CollectionResponse(error);

                return response;
            }
        }
コード例 #2
0
        /// <summary>
        /// 删除收藏
        /// </summary>
        /// <param name="collectionID">收藏编号</param>
        public HttpResponseMessage Delete(int collectionID)
        {
            if (collectionID == 0)
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
            else
            {
                var entity = new Collection() { CollectionID = collectionID };
                CollectionFunction collectionFunction = new CollectionFunction();
                int error = collectionFunction.DeleteCollection(entity);
                var response = GetResponse.CollectionResponse(error);

                return response;
            }
        }