Ejemplo n.º 1
0
        public item GetItem(string objectId)
        {
            itemBLL bll = new itemBLL();

            try
            {
                var model = bll.QuerySingleById(objectId);
                return(model);
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 得到单个用户
 /// </summary>
 /// <param name="v1">版本</param>
 /// <param name="objectId">主键</param>
 /// <returns>用户json</returns>
 public IHttpActionResult GetItem(string v1, string objectId)
 {
     try
     {
         if (string.IsNullOrEmpty(objectId))
         {
             return(invildRequest("itemId不能为空"));
         }
         var model = bll.QuerySingleById(objectId);
         if (model == null)
         {
             return(notFound("没有该记录"));
         }
         return(ok(model));
     }
     catch (Exception e)
     {
         return(execept(e.Message));
     }
 }