public IEnumerable <EmpresasGrupo> DataSourceEmpresasUsuario(int id) { List <EmpresasGrupo> list = new List <EmpresasGrupo>(); try { using (ClusmextContext context = new ClusmextContext()) { list = context.spSelEmpresas_Usuario(id) .Select(x => new EmpresasGrupo { Id = x.Id_Empresa, NombreCompleto = x.Razon_Social }) .OrderBy(x => x.NombreCompleto).ToList(); } } catch (Exception ex) { } return(list); }
public IEnumerable <Datos> DataSourceEmpresasUsuario(int id) { List <Datos> list = new List <Datos>(); try { using (ClusmextContext context = new ClusmextContext()) { list = context.spSelEmpresas_Usuario(id) .Select(x => new Datos { Id = x.Id_Empresa.Value, Texto = x.Razon_Social }) .OrderBy(x => x.Texto).ToList(); } } catch (Exception ex) { } return(list); }