ResourceReader Clase

Definición

Enumera los recursos en un archivo binario de recursos (.resources) leyendo pares secuenciales de nombre/valor del recurso.

public ref class ResourceReader sealed : System::Resources::IResourceReader
public ref class ResourceReader sealed : IDisposable
public ref class ResourceReader sealed : IDisposable, System::Collections::IEnumerable, System::Resources::IResourceReader
public sealed class ResourceReader : System.Resources.IResourceReader
public sealed class ResourceReader : IDisposable
public sealed class ResourceReader : IDisposable, System.Collections.IEnumerable, System.Resources.IResourceReader
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ResourceReader : System.Resources.IResourceReader
type ResourceReader = class
    interface IEnumerable
    interface IDisposable
    interface IResourceReader
type ResourceReader = class
    interface IDisposable
type ResourceReader = class
    interface IResourceReader
    interface IEnumerable
    interface IDisposable
[<System.Runtime.InteropServices.ComVisible(true)>]
type ResourceReader = class
    interface IResourceReader
    interface IEnumerable
    interface IDisposable
Public NotInheritable Class ResourceReader
Implements IResourceReader
Public NotInheritable Class ResourceReader
Implements IDisposable
Public NotInheritable Class ResourceReader
Implements IDisposable, IEnumerable, IResourceReader
Herencia
ResourceReader
Atributos
Implementaciones

Comentarios

Importante

Llamar a métodos de esta clase con datos que no son de confianza supone un riesgo de seguridad. Llame a los métodos de esta clase solo con datos de confianza. Para obtener más información, vea Validar todas las entradas.

La ResourceReader clase proporciona una implementación estándar de la IResourceReader interfaz. Una ResourceReader instancia de representa un archivo .resources independiente o un archivo .resources incrustado en un ensamblado. Se usa para enumerar los recursos de un archivo .resources y recuperar sus pares nombre-valor. Difiere de la ResourceManager clase , que se usa para recuperar recursos con nombre especificados de un archivo .resources insertado en un ensamblado. La ResourceManager clase se usa para recuperar recursos cuyos nombres se conocen de antemano, mientras que la ResourceReader clase es útil para recuperar recursos cuyo número o nombres precisos no se conocen en tiempo de compilación. Por ejemplo, una aplicación puede usar un archivo de recursos para almacenar información de configuración organizada en secciones y elementos de una sección, donde el número de secciones o elementos de una sección no se conoce de antemano. A continuación, los recursos se pueden denominar genéricamente (como Section1, Section1Item1``Section1Item2, , etc.) y recuperarse mediante un ResourceReader objeto .

Importante

Este tipo implementa la interfaz IDisposable. Cuando haya terminado de utilizar el tipo, debe desecharlo directa o indirectamente. Para eliminar el tipo directamente, llame a su método Dispose en un bloque try/catch. Para deshacerse de él indirectamente, use una construcción de lenguaje como using (en C#) o Using (en Visual Basic). Para más información, vea la sección "Uso de objetos que implementan IDisposable" en el tema de la interfaz IDisposable.

Para obtener más información sobre el uso de la ResourceReader clase , consulte las secciones siguientes:

Creación de instancias de un objeto ResourceReader

Un archivo .resources es un archivo binario que se ha compilado a partir de un archivo de texto o un archivo .resx XML mediante Resgen.exe (Generador de archivos de recursos). Un ResourceReader objeto puede representar un archivo .resources independiente o un archivo .resources que se ha incrustado en un ensamblado.

Para crear instancias de un ResourceReader objeto que lee de un archivo .resources independiente, use el ResourceReader constructor de clase con una secuencia de entrada o una cadena que contenga el nombre de archivo .resources. En el ejemplo siguiente se muestran ambos enfoques. El primero crea una instancia de un ResourceReader objeto que representa un archivo .resources denominado Resources1.resources mediante su nombre de archivo. El segundo crea una instancia de un ResourceReader objeto que representa un archivo .resources denominado Resources2.resources mediante una secuencia creada a partir del archivo.

// Instantiate a standalone .resources file from its filename.
var rr1 = new System.Resources.ResourceReader("Resources1.resources");

// Instantiate a standalone .resources file from a stream.
var fs = new System.IO.FileStream(@".\Resources2.resources",
                                  System.IO.FileMode.Open);
var rr2 = new System.Resources.ResourceReader(fs);
' Instantiate a standalone .resources file from its filename.
Dim rr1 As New System.Resources.ResourceReader("Resources1.resources")

' Instantiate a standalone .resources file from a stream.
Dim fs As New System.IO.FileStream(".\Resources2.resources",
                                   System.IO.FileMode.Open)
Dim rr2 As New System.Resources.ResourceReader(fs)

Para crear un objeto que representa un archivo .resources incrustado, cree una ResourceReader instancia de un Assembly objeto del ensamblado en el que se incrusta el archivo .resources. Su Assembly.GetManifestResourceStream método devuelve un Stream objeto que se puede pasar al ResourceReader(Stream) constructor. En el ejemplo siguiente se crea una instancia de un ResourceReader objeto que representa un archivo .resources incrustado.

System.Reflection.Assembly assem = 
             System.Reflection.Assembly.LoadFrom(@".\MyLibrary.dll"); 
System.IO.Stream fs = 
             assem.GetManifestResourceStream("MyCompany.LibraryResources.resources");
var rr = new System.Resources.ResourceReader(fs);
Dim assem As System.Reflection.Assembly = 
             System.Reflection.Assembly.LoadFrom(".\MyLibrary.dll") 
Dim fs As System.IO.Stream = 
             assem.GetManifestResourceStream("MyCompany.LibraryResources.resources")
Dim rr As New System.Resources.ResourceReader(fs)

Enumerar los recursos de un objeto ResourceReader

Para enumerar los recursos de un archivo .resources, llame al GetEnumerator método , que devuelve un System.Collections.IDictionaryEnumerator objeto . Se llama al IDictionaryEnumerator.MoveNext método para pasar de un recurso a otro. El método devuelve false cuando se han enumerado todos los recursos del archivo .resources.

Nota

Aunque la ResourceReader clase implementa la IEnumerable interfaz y el IEnumerable.GetEnumerator método , el ResourceReader.GetEnumerator método no proporciona la IEnumerable.GetEnumerator implementación. En su lugar, el ResourceReader.GetEnumerator método devuelve un IDictionaryEnumerator objeto de interfaz que proporciona acceso al par nombre/valor de cada recurso.

Puede recuperar los recursos individuales de la colección de dos maneras:

Recuperar recursos mediante propiedades de IDictionaryEnumerator

El primer método para enumerar los recursos de un archivo .resources implica recuperar directamente el par nombre/valor de cada recurso. Después de llamar al IDictionaryEnumerator.MoveNext método para pasar a cada recurso de la colección, puede recuperar el nombre del recurso de la IDictionaryEnumerator.Key propiedad y los datos de recursos de la IDictionaryEnumerator.Value propiedad .

En el ejemplo siguiente se muestra cómo recuperar el nombre y el valor de cada recurso en un archivo .resources mediante las IDictionaryEnumerator.Key propiedades y IDictionaryEnumerator.Value . Para ejecutar el ejemplo, cree el siguiente archivo de texto denominado ApplicationResources.txt para definir recursos de cadena.

Title="Contact Information"  
Label1="First Name:"  
Label2="Middle Name:"  
Label3="Last Name:"  
Label4="SSN:"  
Label5="Street Address:"  
Label6="City:"  
Label7="State:"  
Label8="Zip Code:"  
Label9="Home Phone:"  
Label10="Business Phone:"  
Label11="Mobile Phone:"  
Label12="Other Phone:"  
Label13="Fax:"  
Label14="Email Address:"  
Label15="Alternate Email Address:"  

Después, puede convertir el archivo de recursos de texto en un archivo binario denominado ApplicationResources.resources mediante el siguiente comando:

resgen ApplicationResources.txt

A continuación, en el ejemplo siguiente se usa la ResourceReader clase para enumerar cada recurso en el archivo .resources binario independiente y mostrar su nombre de clave y el valor correspondiente.

using System;
using System.Collections;
using System.Resources;

public class Example
{
   public static void Main()
   {
      Console.WriteLine("Resources in ApplicationResources.resources:");
      ResourceReader res = new ResourceReader(@".\ApplicationResources.resources");
      IDictionaryEnumerator dict = res.GetEnumerator();
      while (dict.MoveNext())
         Console.WriteLine("   {0}: '{1}' (Type {2})", 
                           dict.Key, dict.Value, dict.Value.GetType().Name);
      res.Close();
   }
}
// The example displays the following output:
//       Resources in ApplicationResources.resources:
//          Label3: '"Last Name:"' (Type String)
//          Label2: '"Middle Name:"' (Type String)
//          Label1: '"First Name:"' (Type String)
//          Label7: '"State:"' (Type String)
//          Label6: '"City:"' (Type String)
//          Label5: '"Street Address:"' (Type String)
//          Label4: '"SSN:"' (Type String)
//          Label9: '"Home Phone:"' (Type String)
//          Label8: '"Zip Code:"' (Type String)
//          Title: '"Contact Information"' (Type String)
//          Label12: '"Other Phone:"' (Type String)
//          Label13: '"Fax:"' (Type String)
//          Label10: '"Business Phone:"' (Type String)
//          Label11: '"Mobile Phone:"' (Type String)
//          Label14: '"Email Address:"' (Type String)
//          Label15: '"Alternate Email Address:"' (Type String)
Imports System.Collections
Imports System.Resources

Module Example
   Public Sub Main()
      Console.WriteLine("Resources in ApplicationResources.resources:")
      Dim res As New ResourceReader(".\ApplicationResources.resources")
      Dim dict As IDictionaryEnumerator = res.GetEnumerator()
      Do While dict.MoveNext()
         Console.WriteLine("   {0}: '{1}' (Type {2})", dict.Key, dict.Value, dict.Value.GetType().Name)
      Loop
      res.Close()
   End Sub
End Module
' The example displays output like the following:
'       Resources in ApplicationResources.resources:
'          Label3: '"Last Name:"' (Type String)
'          Label2: '"Middle Name:"' (Type String)
'          Label1: '"First Name:"' (Type String)
'          Label7: '"State:"' (Type String)
'          Label6: '"City:"' (Type String)
'          Label5: '"Street Address:"' (Type String)
'          Label4: '"SSN:"' (Type String)
'          Label9: '"Home Phone:"' (Type String)
'          Label8: '"Zip Code:"' (Type String)
'          Title: '"Contact Information"' (Type String)
'          Label12: '"Other Phone:"' (Type String)
'          Label13: '"Fax:"' (Type String)
'          Label10: '"Business Phone:"' (Type String)
'          Label11: '"Mobile Phone:"' (Type String)
'          Label14: '"Email Address:"' (Type String)
'          Label15: '"Alternate Email Address:"' (Type String)

El intento de recuperar datos de recursos de la IDictionaryEnumerator.Value propiedad puede producir las siguientes excepciones:

Normalmente, estas excepciones se producen si el archivo .resources se ha modificado manualmente, si el ensamblado en el que se define un tipo no se ha incluido con una aplicación o se ha eliminado accidentalmente, o si el ensamblado es una versión anterior que precede a un tipo. Si se produce una de estas excepciones, puede recuperar recursos mediante la enumeración de cada recurso y la llamada al GetResourceData método , como se muestra en la sección siguiente. Este enfoque proporciona información sobre el tipo de datos que la IDictionaryEnumerator.Value propiedad intentó devolver.

Recuperación de recursos por nombre con GetResourceData

El segundo enfoque para enumerar recursos en un archivo .resources también implica navegar por los recursos del archivo llamando al IDictionaryEnumerator.MoveNext método . Para cada recurso, se recupera el nombre del recurso de la IDictionaryEnumerator.Key propiedad , que se pasa al GetResourceData(String, String, Byte[]) método para recuperar los datos del recurso. Se devuelve como una matriz de bytes en el resourceData argumento .

Este enfoque es más incómodo que recuperar el nombre y el valor del recurso de las IDictionaryEnumerator.Key propiedades y IDictionaryEnumerator.Value , ya que devuelve los bytes reales que forman el valor del recurso. Sin embargo, si el intento de recuperar el recurso produce una excepción, el GetResourceData método puede ayudar a identificar el origen de la excepción proporcionando información sobre el tipo de datos del recurso. Para obtener más información sobre la cadena que indica el tipo de datos del recurso, vea GetResourceData.

En el ejemplo siguiente se muestra cómo usar este enfoque para recuperar recursos y controlar las excepciones que se producen. Crea mediante programación un archivo .resources binario que contiene cuatro cadenas, un booleano, un entero, un mapa de bits y un objeto personalizado DateTimeTZI . Para ejecutar el ejemplo, haga lo siguiente:

  1. Cree un ensamblado denominado Library.dll que contenga la DateTimeTZI estructura. A continuación se muestra el código fuente del ensamblado.

    using System;
    
    [Serializable] public struct DateTimeTZI
    {
      DateTime Date;
      TimeZoneInfo TimeZone;
       
      public DateTimeTZI(DateTime date, TimeZoneInfo tz)
      {
         this.Date = date;
         this.TimeZone = tz;
      }
    
       public override string ToString()
       {
         return String.Format("{0:dd/MM/yyyy hh:mm:ss tt} {1}", 
                              Date, TimeZone.StandardName);
       }
    }
    
    <Serializable> Public Structure DateTimeTZI
      Dim [Date] As DateTime
      Dim TimeZone As TimeZoneInfo
       
      Public Sub New([date] As DateTime, tz As TimeZoneInfo)
         Me.[Date] = [date]
         Me.TimeZone = tz
      End Sub
      
      Public Overrides Function ToString() As String
         Return String.Format("{0:dd/MM/yyyy hh:mm:ss tt} {1}", 
                              [Date], TimeZone.StandardName)
      End Function
    End Structure
    

    Compile el código fuente en C# con el siguiente comando:

    csc /t:library library.cs  
    

    O bien, puede compilarlo en Visual Basic mediante el siguiente comando:

    vbc library.vb /t:library  
    
  2. Compile y ejecute el siguiente código fuente, que crea un archivo .resources denominado ContactResources.resources.

    using System;
    using System.Drawing;
    using System.Drawing.Imaging;
    using System.IO;
    using System.Resources;
    using System.Runtime.Serialization.Formatters.Binary;
    using System.Text;
    
    public class Example
    {
       public static void Main()
       {
          // Bitmap as stream.
          MemoryStream bitmapStream = new MemoryStream();
          Bitmap bmp = new Bitmap(@".\ContactsIcon.jpg");
          bmp.Save(bitmapStream, ImageFormat.Jpeg);
              
          // Define resources to be written.
          using (ResourceWriter rw = new ResourceWriter(@".\ContactResources.resources"))
          {
             rw.AddResource("Title", "Contact List");
             rw.AddResource("NColumns", 5);         
             rw.AddResource("Icon", bitmapStream);         
             rw.AddResource("Header1", "Name");
             rw.AddResource("Header2", "City");
             rw.AddResource("Header3", "State");  
             rw.AddResource("VersionDate", new DateTimeTZI(
                            new DateTime(2012, 5, 18),  
                            TimeZoneInfo.Local));
             rw.AddResource("ClientVersion", true);
             rw.Generate();
          }
       }
    }
    
    Imports System.Drawing
    Imports System.IO
    Imports System.Resources
    Imports System.Runtime.Serialization.Formatters.Binary
    
    Imports System.Text
    
    Module Example
       Public Sub Main()
          ' Bitmap as stream.
          Dim bitmapStream As New MemoryStream()
          Dim bmp As New Bitmap(".\ContactsIcon.jpg")
          bmp.Save(bitmapStream, Imaging.ImageFormat.jpeg)
              
          ' Define resources to be written.
          Using rw As New ResourceWriter(".\ContactResources.resources")
             rw.AddResource("Title", "Contact List")
             rw.AddResource("NColumns", 5)         
             rw.AddResource("Icon", bitmapStream)         
             rw.AddResource("Header1", "Name")
             rw.AddResource("Header2", "City")
             rw.AddResource("Header3", "State")  
             rw.AddResource("VersionDate", New DateTimeTZI(#05/18/2012#, 
                                                           TimeZoneInfo.Local))
             rw.AddResource("ClientVersion", True)
             rw.Generate()
          End Using
       End Sub
    End Module
    

    El archivo de código fuente se denomina CreateResources.cs. Puede compilarlo en C# mediante el siguiente comando:

    csc CreateResources.cs /r:library.dll  
    

    O bien, puede compilarlo en Visual Basic mediante el siguiente comando:

    vbc CreateResources.vb /r:library.dll  
    
  3. Compile y ejecute el código siguiente para enumerar los recursos en el archivo ContactResources.resources.

    using System;
    using System.Collections;
    using System.Drawing;
    using System.IO;
    using System.Resources;
    using System.Runtime.Serialization.Formatters.Binary;
    
    public class Example
    {
       public static void Main()
       {
          ResourceReader rdr = new ResourceReader(@".\ContactResources.resources");  
          IDictionaryEnumerator dict = rdr.GetEnumerator();
          while (dict.MoveNext()) {
             Console.WriteLine("Resource Name: {0}", dict.Key);
             try {
                Console.WriteLine("   Value: {0}", dict.Value);
             }
             catch (FileNotFoundException) {
                Console.WriteLine("   Exception: A file cannot be found.");
                DisplayResourceInfo(rdr, (string) dict.Key, false);
             }
             catch (FormatException) {
                Console.WriteLine("   Exception: Corrupted data.");
                DisplayResourceInfo(rdr, (string) dict.Key, true);
             }
             catch (TypeLoadException) {
                Console.WriteLine("   Exception: Cannot load the data type.");
                DisplayResourceInfo(rdr, (string) dict.Key, false);   
             }
          } 
       }
    
       private static void DisplayResourceInfo(ResourceReader rr, 
                                       string key, bool loaded)
       {                                
          string dataType = null;
          byte[] data = null;
          rr.GetResourceData(key, out dataType, out data);
                
          // Display the data type.
          Console.WriteLine("   Data Type: {0}", dataType);
          // Display the bytes that form the available data.      
          Console.Write("   Data: ");
          int lines = 0;
          foreach (var dataItem in data) {
             lines++;
             Console.Write("{0:X2} ", dataItem);
             if (lines % 25 == 0)
                Console.Write("\n         ");
          }
          Console.WriteLine();
          // Try to recreate current state of  data.
          // Do: Bitmap, DateTimeTZI
          switch (dataType) 
          {  
             // Handle internally serialized string data (ResourceTypeCode members).
             case "ResourceTypeCode.String":
                BinaryReader reader = new BinaryReader(new MemoryStream(data));
                string binData = reader.ReadString();
                Console.WriteLine("   Recreated Value: {0}", binData);
                break;
             case "ResourceTypeCode.Int32":
                Console.WriteLine("   Recreated Value: {0}", 
                                  BitConverter.ToInt32(data, 0));
                break;
             case "ResourceTypeCode.Boolean":
                Console.WriteLine("   Recreated Value: {0}", 
                                  BitConverter.ToBoolean(data, 0));
                break;
             // .jpeg image stored as a stream.
             case "ResourceTypeCode.Stream":  
                const int OFFSET = 4;
                int size = BitConverter.ToInt32(data, 0);
                Bitmap value1 = new Bitmap(new MemoryStream(data, OFFSET, size));
                Console.WriteLine("   Recreated Value: {0}", value1); 
                break;
             // Our only other type is DateTimeTZI.
             default:
                // No point in deserializing data if the type is unavailable.
                if (dataType.Contains("DateTimeTZI") && loaded) { 
                   BinaryFormatter binFmt = new BinaryFormatter();
                   object value2 = binFmt.Deserialize(new MemoryStream(data));
                   Console.WriteLine("   Recreated Value: {0}", value2);
                }    
                break;
          }
          Console.WriteLine();
       }
    }
    
    Imports System.Collections
    Imports System.Drawing
    Imports System.IO
    Imports System.Resources
    Imports System.Runtime.Serialization.Formatters.Binary
    
    Module Example
       Public Sub Main()
          Dim rdr As New ResourceReader(".\ContactResources.resources")  
          Dim dict As IDictionaryEnumerator = rdr.GetEnumerator()
          Do While dict.MoveNext()
             Console.WriteLine("Resource Name: {0}", dict.Key)
             Try
                Console.WriteLine("   Value: {0}", dict.Value)
             Catch e As FileNotFoundException
                Console.WriteLine("   Exception: A file cannot be found.")
                DisplayResourceInfo(rdr, CStr(dict.Key), False)
             Catch e As FormatException
                Console.WriteLine("   Exception: Corrupted data.")
                DisplayResourceInfo(rdr, CStr(dict.Key), True)
             Catch e As TypeLoadException
                Console.WriteLine("   Exception: Cannot load the data type.")
                DisplayResourceInfo(rdr, CStr(dict.Key), False)   
             End Try
          Loop 
       End Sub
    
       Private Sub DisplayResourceInfo(rr As ResourceReader, 
                                       key As String, loaded As Boolean)
          Dim dataType As String = Nothing
          Dim data() As Byte = Nothing
          rr.GetResourceData(key, dataType, data)
                
          ' Display the data type.
          Console.WriteLine("   Data Type: {0}", dataType)
          ' Display the bytes that form the available data.      
          Console.Write("   Data: ")
          Dim lines As Integer = 0
          For Each dataItem In data
             lines += 1
             Console.Write("{0:X2} ", dataItem)
             If lines Mod 25 = 0 Then Console.Write("{0}         ", vbCrLf)
          Next
          Console.WriteLine()
          ' Try to recreate current state of  data.
          ' Do: Bitmap, DateTimeTZI
          Select Case dataType   
             ' Handle internally serialized string data (ResourceTypeCode members).
             Case "ResourceTypeCode.String"
                Dim reader As New BinaryReader(New MemoryStream(data))
                Dim binData As String = reader.ReadString()
                Console.WriteLine("   Recreated Value: {0}", binData)
             Case "ResourceTypeCode.Int32"
                Console.WriteLine("   Recreated Value: {0}", 
                                  BitConverter.ToInt32(data, 0))
             Case "ResourceTypeCode.Boolean"
                Console.WriteLine("   Recreated Value: {0}", 
                                  BitConverter.ToBoolean(data, 0))
             ' .jpeg image stored as a stream.
             Case "ResourceTypeCode.Stream"  
                Const OFFSET As Integer = 4
                Dim size As Integer = BitConverter.ToInt32(data, 0)
                Dim value As New Bitmap(New MemoryStream(data, OFFSET, size))
                Console.WriteLine("   Recreated Value: {0}", value) 
             ' Our only other type is DateTimeTZI.
             Case Else
                ' No point in deserializing data if the type is unavailable.
                If dataType.Contains("DateTimeTZI") And loaded Then 
                   Dim binFmt As New BinaryFormatter()
                   Dim value As Object = binFmt.Deserialize(New MemoryStream(data))
                   Console.WriteLine("   Recreated Value: {0}", value)
                End If    
          End Select
          Console.WriteLine()
       End Sub
    End Module
    

    Después de modificar el código fuente (por ejemplo, iniciando deliberadamente un FormatException al final del try bloque) o cambiando el nombre del ensamblado de Library.dll para que no esté disponible en tiempo de ejecución, puede ejecutar el ejemplo para ver cómo las llamadas para GetResourceData permitirle recuperar o volver a crear alguna información de recursos.

Constructores

ResourceReader(Stream)

Inicializa una nueva instancia de la clase ResourceReader para el flujo especificado.

ResourceReader(String)

Inicializa una nueva instancia de la clase ResourceReader para el archivo de recursos con nombre especificado.

Métodos

Close()

Libera todos los recursos del sistema operativo asociados a este objeto ResourceReader.

Dispose()

Libera todos los recursos usados por la instancia actual de la clase ResourceReader.

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetEnumerator()

Devuelve un enumerador para este objeto ResourceReader.

GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetResourceData(String, String, Byte[])

Recupera el nombre de tipo y datos de un recurso con nombre a partir de un archivo de recursos o secuencia abiertos.

GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Implementaciones de interfaz explícitas

IDisposable.Dispose()

Libera los recursos que usa ResourceReader.

IEnumerable.GetEnumerator()

Devuelve un enumerador para este objeto ResourceReader.

Métodos de extensión

Cast<TResult>(IEnumerable)

Convierte los elementos de IEnumerable en el tipo especificado.

OfType<TResult>(IEnumerable)

Filtra los elementos de IEnumerable en función de un tipo especificado.

AsParallel(IEnumerable)

Habilita la paralelización de una consulta.

AsQueryable(IEnumerable)

Convierte una interfaz IEnumerable en IQueryable.

Se aplica a