EntityCodeGenerator.GenerateCode 方法

定义

生成源代码,其中包含从概念性架构定义语言 (CSDL) 生成的对象。Generates source code that contains the objects generated from the conceptual schema definition language (CSDL).

重载

GenerateCode(String, String)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains the object layer code generated from the specified conceptual schema definition language (CSDL) file.

GenerateCode(XmlReader, TextWriter)

使用 XmlReader 对象中指定的概念性架构定义语言 (CSDL) 生成对象层代码,然后将生成的代码输出到 TextWriterGenerates object layer code using the conceptual schema definition language (CSDL) specified in the XmlReader object, and outputs the generated code to a TextWriter.

GenerateCode(String, String, IEnumerable<String>)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains object layer code generated from the specified conceptual schema definition language (CSDL) file. 架构文件路径的列表用于解析包含在 CSDL 文件中的任何引用。The list of schema file paths is used to resolve any references contained in the CSDL file.

GenerateCode(String, String, Version)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains the object layer code generated from the specified conceptual schema definition language (CSDL) file. 注意 targetEntityFrameworkVersion 参数使用内部 Entity Framework 版本数字如EntityFrameworkVersions 中的描述。Note that the targetEntityFrameworkVersion parameter uses internal Entity Framework version numbers as described in the EntityFrameworkVersions class.

GenerateCode(XmlReader, TextWriter, IEnumerable<XmlReader>)

基于 XmlReader 对象中指定的概念性架构定义语言 (CSDL) 生成对象层代码,然后将生成的代码输出到 TextWriterGenerates object layer code based on the conceptual schema definition language (CSDL) specified in the XmlReader object, then outputs the generated code to a TextWriter. XmlReader 对象的列表,用于解析 CSDL 中包含的任何引用。A list of XmlReader objects is used to resolve any references that are contained in the CSDL.

GenerateCode(XmlReader, TextWriter, Version)

使用 XmlReader 对象中指定的概念性架构定义语言 (CSDL) 生成对象层代码,然后将生成的代码输出到 TextWriter。Generates object layer code using the conceptual schema definition language (CSDL) specified in the XmlReader object, and outputs the generated code to a TextWriter. 注意 targetEntityFrameworkVersion 参数使用内部 Entity Framework 版本数字如EntityFrameworkVersions 中的描述。Note that the targetEntityFrameworkVersion parameter uses internal EntityFramework version numbers as described in the EntityFrameworkVersions class.

GenerateCode(String, String, IEnumerable<String>, Version)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains object layer code generated from the specified conceptual schema definition language (CSDL) file. 架构文件路径的列表用于解析包含在 CSDL 文件中的任何引用。The list of schema file paths is used to resolve any references contained in the CSDL file. 注意 targetEntityFrameworkVersion 参数使用内部 Entity Framework 版本数字如EntityFrameworkVersions 中的描述。Note that the targetEntityFrameworkVersion parameter uses internal EntityFramework version numbers as described in the EntityFrameworkVersions class.

GenerateCode(XmlReader, TextWriter, IEnumerable<XmlReader>, Version)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains the object layer code generated from the specified conceptual schema definition language (CSDL) file. 注意 targetEntityFrameworkVersion 参数使用内部 Entity Framework 版本数字如EntityFrameworkVersions 中的描述。Note that the targetEntityFrameworkVersion parameter uses internal Entity Framework version numbers as described in the EntityFrameworkVersions class.

GenerateCode(String, String)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains the object layer code generated from the specified conceptual schema definition language (CSDL) file.

public:
 System::Collections::Generic::IList<System::Data::Metadata::Edm::EdmSchemaError ^> ^ GenerateCode(System::String ^ sourceEdmSchemaFilePath, System::String ^ targetPath);
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode (string sourceEdmSchemaFilePath, string targetPath);
member this.GenerateCode : string * string -> System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError>
Public Function GenerateCode (sourceEdmSchemaFilePath As String, targetPath As String) As IList(Of EdmSchemaError)

参数

sourceEdmSchemaFilePath
String

CSDL 文件的路径。The path of the CSDL file.

targetPath
String

包含生成的对象层代码的文件的路径。The path of the file that contains the generated object layer code.

返回

IList<EdmSchemaError>

一个 EdmSchemaError 对象列表,其中包含所有生成的错误。A list of EdmSchemaError objects that contains any generated errors.

适用于

GenerateCode(XmlReader, TextWriter)

使用 XmlReader 对象中指定的概念性架构定义语言 (CSDL) 生成对象层代码,然后将生成的代码输出到 TextWriterGenerates object layer code using the conceptual schema definition language (CSDL) specified in the XmlReader object, and outputs the generated code to a TextWriter.

public:
 System::Collections::Generic::IList<System::Data::Metadata::Edm::EdmSchemaError ^> ^ GenerateCode(System::Xml::XmlReader ^ sourceEdmSchema, System::IO::TextWriter ^ target);
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode (System.Xml.XmlReader sourceEdmSchema, System.IO.TextWriter target);
member this.GenerateCode : System.Xml.XmlReader * System.IO.TextWriter -> System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError>
Public Function GenerateCode (sourceEdmSchema As XmlReader, target As TextWriter) As IList(Of EdmSchemaError)

参数

sourceEdmSchema
XmlReader

一个 XmlReader,其中包含 CSDL。An XmlReader that contains the CSDL.

target
TextWriter

对象层代码将被写入到的 TextWriterThe TextWriter to which the object layer code is written.

返回

IList<EdmSchemaError>

一个 EdmSchemaError 对象列表,其中包含所有生成的错误。A list of EdmSchemaError objects that contains any generated errors.

适用于

GenerateCode(String, String, IEnumerable<String>)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains object layer code generated from the specified conceptual schema definition language (CSDL) file. 架构文件路径的列表用于解析包含在 CSDL 文件中的任何引用。The list of schema file paths is used to resolve any references contained in the CSDL file.

public:
 System::Collections::Generic::IList<System::Data::Metadata::Edm::EdmSchemaError ^> ^ GenerateCode(System::String ^ sourceEdmSchemaFilePath, System::String ^ targetPath, System::Collections::Generic::IEnumerable<System::String ^> ^ additionalEdmSchemaFilePaths);
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode (string sourceEdmSchemaFilePath, string targetPath, System.Collections.Generic.IEnumerable<string> additionalEdmSchemaFilePaths);
member this.GenerateCode : string * string * seq<string> -> System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError>
Public Function GenerateCode (sourceEdmSchemaFilePath As String, targetPath As String, additionalEdmSchemaFilePaths As IEnumerable(Of String)) As IList(Of EdmSchemaError)

参数

sourceEdmSchemaFilePath
String

CSDL 文件的路径。The path of the CSDL file.

targetPath
String

包含生成的对象层代码的文件的路径。The path of the file that contains the generated object layer code.

additionalEdmSchemaFilePaths
IEnumerable<String>

架构文件路径的列表,可用于解析源架构(CSDL 文件)中的任何引用。A list of schema file paths that can be used to resolve any references in the source schema (the CSDL file). 如果源架构没有任何依赖项,则传入空列表。If the source schema does not have any dependencies, pass in an empty list.

返回

IList<EdmSchemaError>

一个 EdmSchemaError 对象列表,其中包含所有生成的错误。A list of EdmSchemaError objects that contains any generated errors.

适用于

GenerateCode(String, String, Version)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains the object layer code generated from the specified conceptual schema definition language (CSDL) file. 注意 targetEntityFrameworkVersion 参数使用内部 Entity Framework 版本数字如EntityFrameworkVersions 中的描述。Note that the targetEntityFrameworkVersion parameter uses internal Entity Framework version numbers as described in the EntityFrameworkVersions class.

public:
 System::Collections::Generic::IList<System::Data::Metadata::Edm::EdmSchemaError ^> ^ GenerateCode(System::String ^ sourceEdmSchemaFilePath, System::String ^ targetPath, Version ^ targetEntityFrameworkVersion);
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode (string sourceEdmSchemaFilePath, string targetPath, Version targetEntityFrameworkVersion);
member this.GenerateCode : string * string * Version -> System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError>
Public Function GenerateCode (sourceEdmSchemaFilePath As String, targetPath As String, targetEntityFrameworkVersion As Version) As IList(Of EdmSchemaError)

参数

sourceEdmSchemaFilePath
String

CSDL 文件的路径。The path of the CSDL file.

targetPath
String

包含生成的对象层代码的文件的路径。The path of the file that contains the generated object layer code.

targetEntityFrameworkVersion
Version

以内部 Entity Framework 版本为目标。The internal Entity Framework version that is being targeted.

返回

IList<EdmSchemaError>

一个 EdmSchemaError 对象列表,其中包含所有生成的错误。A list of EdmSchemaError objects that contains any generated errors.

适用于

GenerateCode(XmlReader, TextWriter, IEnumerable<XmlReader>)

基于 XmlReader 对象中指定的概念性架构定义语言 (CSDL) 生成对象层代码,然后将生成的代码输出到 TextWriterGenerates object layer code based on the conceptual schema definition language (CSDL) specified in the XmlReader object, then outputs the generated code to a TextWriter. XmlReader 对象的列表,用于解析 CSDL 中包含的任何引用。A list of XmlReader objects is used to resolve any references that are contained in the CSDL.

public:
 System::Collections::Generic::IList<System::Data::Metadata::Edm::EdmSchemaError ^> ^ GenerateCode(System::Xml::XmlReader ^ sourceEdmSchema, System::IO::TextWriter ^ target, System::Collections::Generic::IEnumerable<System::Xml::XmlReader ^> ^ additionalEdmSchemas);
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode (System.Xml.XmlReader sourceEdmSchema, System.IO.TextWriter target, System.Collections.Generic.IEnumerable<System.Xml.XmlReader> additionalEdmSchemas);
member this.GenerateCode : System.Xml.XmlReader * System.IO.TextWriter * seq<System.Xml.XmlReader> -> System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError>
Public Function GenerateCode (sourceEdmSchema As XmlReader, target As TextWriter, additionalEdmSchemas As IEnumerable(Of XmlReader)) As IList(Of EdmSchemaError)

参数

sourceEdmSchema
XmlReader

一个 XmlReader,其中包含 CSDL。An XmlReader that contains the CSDL.

target
TextWriter

用来输出生成对象层代码的 TextWriterThe TextWriter to output the generated object layer code.

additionalEdmSchemas
IEnumerable<XmlReader>

XmlReader 对象的列表,其中包含由源架构 (CSDL) 引用的架构。A list of XmlReader objects that contain schemas that are referenced by the source schema (the CSDL). 如果源架构没有任何依赖项,则传入空列表。If the source schema does not have any dependencies, pass in an empty list.

返回

IList<EdmSchemaError>

一个 EdmSchemaError 对象列表,其中包含所有生成的错误。A list of EdmSchemaError objects that contains any generated errors.

适用于

GenerateCode(XmlReader, TextWriter, Version)

使用 XmlReader 对象中指定的概念性架构定义语言 (CSDL) 生成对象层代码,然后将生成的代码输出到 TextWriter。Generates object layer code using the conceptual schema definition language (CSDL) specified in the XmlReader object, and outputs the generated code to a TextWriter. 注意 targetEntityFrameworkVersion 参数使用内部 Entity Framework 版本数字如EntityFrameworkVersions 中的描述。Note that the targetEntityFrameworkVersion parameter uses internal EntityFramework version numbers as described in the EntityFrameworkVersions class.

public:
 System::Collections::Generic::IList<System::Data::Metadata::Edm::EdmSchemaError ^> ^ GenerateCode(System::Xml::XmlReader ^ sourceEdmSchema, System::IO::TextWriter ^ target, Version ^ targetEntityFrameworkVersion);
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode (System.Xml.XmlReader sourceEdmSchema, System.IO.TextWriter target, Version targetEntityFrameworkVersion);
member this.GenerateCode : System.Xml.XmlReader * System.IO.TextWriter * Version -> System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError>
Public Function GenerateCode (sourceEdmSchema As XmlReader, target As TextWriter, targetEntityFrameworkVersion As Version) As IList(Of EdmSchemaError)

参数

sourceEdmSchema
XmlReader

包含 CSDL 的 XmlReader 文件。An XmlReader that contains the CSDL.

target
TextWriter

对象层代码将被写入到的 TextWriter。The TextWriter to which the object layer code is written.

targetEntityFrameworkVersion
Version

以内部 Entity Framework 版本为目标。The internal Entity Framework version that is being targeted.

返回

IList<EdmSchemaError>

一个 EdmSchemaError 对象列表,其中包含所有生成的错误。A list of EdmSchemaError objects that contains any generated errors.

适用于

GenerateCode(String, String, IEnumerable<String>, Version)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains object layer code generated from the specified conceptual schema definition language (CSDL) file. 架构文件路径的列表用于解析包含在 CSDL 文件中的任何引用。The list of schema file paths is used to resolve any references contained in the CSDL file. 注意 targetEntityFrameworkVersion 参数使用内部 Entity Framework 版本数字如EntityFrameworkVersions 中的描述。Note that the targetEntityFrameworkVersion parameter uses internal EntityFramework version numbers as described in the EntityFrameworkVersions class.

public:
 System::Collections::Generic::IList<System::Data::Metadata::Edm::EdmSchemaError ^> ^ GenerateCode(System::String ^ sourceEdmSchemaFilePath, System::String ^ targetPath, System::Collections::Generic::IEnumerable<System::String ^> ^ additionalEdmSchemaFilePaths, Version ^ targetEntityFrameworkVersion);
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode (string sourceEdmSchemaFilePath, string targetPath, System.Collections.Generic.IEnumerable<string> additionalEdmSchemaFilePaths, Version targetEntityFrameworkVersion);
member this.GenerateCode : string * string * seq<string> * Version -> System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError>
Public Function GenerateCode (sourceEdmSchemaFilePath As String, targetPath As String, additionalEdmSchemaFilePaths As IEnumerable(Of String), targetEntityFrameworkVersion As Version) As IList(Of EdmSchemaError)

参数

sourceEdmSchemaFilePath
String

CSDL 文件的路径。The path of the CSDL file.

targetPath
String

包含生成的对象层代码的文件的路径。The path of the file that contains the generated object layer code.

additionalEdmSchemaFilePaths
IEnumerable<String>

架构文件路径的列表,可用于解析源架构(CSDL 文件)中的任何引用。A list of schema file paths that can be used to resolve any references in the source schema (the CSDL file). 如果源架构没有任何依赖项,则传入空列表。If the source schema does not have any dependencies, pass in an empty list.

targetEntityFrameworkVersion
Version

以内部 Entity Framework 版本为目标。The internal Entity Framework version that is being targeted.

返回

IList<EdmSchemaError>

一个 EdmSchemaError 对象列表,其中包含所有生成的错误。A list of EdmSchemaError objects that contains any generated errors.

适用于

GenerateCode(XmlReader, TextWriter, IEnumerable<XmlReader>, Version)

创建一个源代码文件,其中包含从指定的概念性架构定义语言 (CSDL) 文件生成的对象层代码。Creates a source code file that contains the object layer code generated from the specified conceptual schema definition language (CSDL) file. 注意 targetEntityFrameworkVersion 参数使用内部 Entity Framework 版本数字如EntityFrameworkVersions 中的描述。Note that the targetEntityFrameworkVersion parameter uses internal Entity Framework version numbers as described in the EntityFrameworkVersions class.

public:
 System::Collections::Generic::IList<System::Data::Metadata::Edm::EdmSchemaError ^> ^ GenerateCode(System::Xml::XmlReader ^ sourceEdmSchema, System::IO::TextWriter ^ target, System::Collections::Generic::IEnumerable<System::Xml::XmlReader ^> ^ additionalEdmSchemas, Version ^ targetEntityFrameworkVersion);
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode (System.Xml.XmlReader sourceEdmSchema, System.IO.TextWriter target, System.Collections.Generic.IEnumerable<System.Xml.XmlReader> additionalEdmSchemas, Version targetEntityFrameworkVersion);
member this.GenerateCode : System.Xml.XmlReader * System.IO.TextWriter * seq<System.Xml.XmlReader> * Version -> System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError>
Public Function GenerateCode (sourceEdmSchema As XmlReader, target As TextWriter, additionalEdmSchemas As IEnumerable(Of XmlReader), targetEntityFrameworkVersion As Version) As IList(Of EdmSchemaError)

参数

sourceEdmSchema
XmlReader

包含 CSDL 的 XmlReader 文件。An XmlReader that contains the CSDL.

target
TextWriter

对象层代码将被写入到的 TextWriter。The TextWriter to which the object layer code is written.

additionalEdmSchemas
IEnumerable<XmlReader>

XmlReader 对象的列表,其中包含由源架构 (CSDL) 引用的架构。A list of XmlReader objects that contain schemas that are referenced by the source schema (the CSDL). 如果源架构没有任何依赖关系,则传入空的 IList 对象。If the source schema does not have any dependencies, pass in an empty IList object.

targetEntityFrameworkVersion
Version

以内部 Entity Framework 版本为目标。The internal Entity Framework version that is being targeted.

返回

IList<EdmSchemaError>

一个 EdmSchemaError 对象列表,其中包含所有生成的错误。A list of EdmSchemaError objects that contains any generated errors.

适用于