示例#1
0
 public IHttpActionResult GetLnkUDO()
 {
     try
     {
         EFLnkUDO      ef_act = new EFLnkUDO(new EFDbContext());
         List <LnkUDO> list   = ef_act
                                .Context
                                .ToList()
                                .Select(m => m.GetLnkUDO())
                                .ToList();
         return(Ok(list));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
示例#2
0
 public IHttpActionResult GetLnkUDOOfID(int id)
 {
     try
     {
         EFLnkUDO ef_act = new EFLnkUDO(new EFDbContext());
         LnkUDO   link   = ef_act
                           .Context
                           .Where(d => d.idLinkUDO == id)
                           .ToList()
                           .Select(m => m.GetLnkUDO())
                           .FirstOrDefault();
         return(Ok(link));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }