Ejemplo n.º 1
0
 public List <clientes> GetList(string linea)
 {
     try
     {
         using (var db = new NtLinkLocalServiceEntities())
         {
             string query = "select Value c from NtLinkLocalServiceEntities.clientes as c inner join NtLinkLocalServiceEntities.empresa as b " +
                            " ON (c.idempresa = b.IdEmpresa) where b.Linea = @linea";
             ObjectParameter op     = new ObjectParameter("linea", linea);
             var             q      = db.CreateQuery <clientes>(query, new [] { op }).OrderBy(p => p.RazonSocial);
             var             result = q.ToList();
             return(result);
         }
     }
     catch (Exception ee)
     {
         Logger.Error(ee.Message);
         if (ee.InnerException != null)
         {
             Logger.Error(ee.InnerException);
         }
         return(null);
     }
 }