Example #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public override ReturnData Delete(object request)
        {
            RequesList <Emenu> menu        = (RequesList <Emenu>)request;
            Interactive        interactive = new Interactive();

            interactive.Delete(menu.Model);
            var items = new List <KeyValuePair <long, string> >();

            if (interactive.Result.Item1)
            {
                items.Add(new KeyValuePair <long, string>(menu.Model.Id, Convert.ToString(menu.Model.Id)));
                Client.RemoveAsync <Emenu>(GetKey(), items, "Id");
                return(new ReturnData {
                    sucess = Client.Sucess, msg = menu.Model.Id.ToString()
                });
            }
            else
            {
                return(new ErrorData {
                    sucess = Client.Sucess, code = Client.Code, msg = "关系型数据库出错"
                });
            }
        }