EntityCodeGenerator.GenerateCode 方法

定义

生成源代码,其中包含从概念架构定义语言 (CSDL) 生成的对象。

重载

名称 说明
GenerateCode(String, String)

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。

GenerateCode(XmlReader, TextWriter)

使用对象中指定的 XmlReader 概念架构定义语言(CSDL)生成对象层代码,并将生成的代码输出到 a TextWriter

GenerateCode(String, String, IEnumerable<String>)

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。 架构文件路径列表用于解析 CSDL 文件中包含的任何引用。

GenerateCode(String, String, Version)

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。 请注意,targetEntityFrameworkVersion 参数使用类中所述 EntityFrameworkVersions 的内部 Entity Framework 版本号。

GenerateCode(XmlReader, TextWriter, IEnumerable<XmlReader>)

根据对象中指定的 XmlReader 概念架构定义语言(CSDL)生成对象层代码,然后将生成的代码输出到一个 TextWriter。 对象列表 XmlReader 用于解析 CSDL 中包含的任何引用。

GenerateCode(XmlReader, TextWriter, Version)

使用 XmlReader 对象中指定的概念架构定义语言(CSDL)生成对象层代码,并将生成的代码输出到 TextWriter。 请注意,targetEntityFrameworkVersion 参数使用内部 EntityFramework 版本号, EntityFrameworkVersions 如类中所述。

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

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。 架构文件路径列表用于解析 CSDL 文件中包含的任何引用。 请注意,targetEntityFrameworkVersion 参数使用内部 EntityFramework 版本号, EntityFrameworkVersions 如类中所述。

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

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。 请注意,targetEntityFrameworkVersion 参数使用类中所述 EntityFrameworkVersions 的内部 Entity Framework 版本号。

GenerateCode(String, String)

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。

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 文件的路径。

targetPath
String

包含生成的对象层代码的文件的路径。

返回

包含任何生成的错误的对象的列表 EdmSchemaError

适用于

GenerateCode(XmlReader, TextWriter)

使用对象中指定的 XmlReader 概念架构定义语言(CSDL)生成对象层代码,并将生成的代码输出到 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

包含 CSDL 的一个 XmlReader

target
TextWriter

TextWriter对象层代码的写入对象层代码。

返回

包含任何生成的错误的对象的列表 EdmSchemaError

适用于

GenerateCode(String, String, IEnumerable<String>)

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。 架构文件路径列表用于解析 CSDL 文件中包含的任何引用。

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 文件的路径。

targetPath
String

包含生成的对象层代码的文件的路径。

additionalEdmSchemaFilePaths
IEnumerable<String>

可用于解析源架构(CSDL 文件)中的任何引用的架构文件路径列表。 如果源架构没有任何依赖项,请传入空列表。

返回

包含任何生成的错误的对象的列表 EdmSchemaError

适用于

GenerateCode(String, String, Version)

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。 请注意,targetEntityFrameworkVersion 参数使用类中所述 EntityFrameworkVersions 的内部 Entity Framework 版本号。

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 文件的路径。

targetPath
String

包含生成的对象层代码的文件的路径。

targetEntityFrameworkVersion
Version

要面向的内部 Entity Framework 版本。

返回

包含任何生成的错误的对象的列表 EdmSchemaError

适用于

GenerateCode(XmlReader, TextWriter, IEnumerable<XmlReader>)

根据对象中指定的 XmlReader 概念架构定义语言(CSDL)生成对象层代码,然后将生成的代码输出到一个 TextWriter。 对象列表 XmlReader 用于解析 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

包含 CSDL 的一个 XmlReader

target
TextWriter

输出 TextWriter 生成的对象层代码。

additionalEdmSchemas
IEnumerable<XmlReader>

包含源架构(CSDL)引用的架构的对象列表 XmlReader 。 如果源架构没有任何依赖项,请传入空列表。

返回

包含任何生成的错误的对象的列表 EdmSchemaError

适用于

GenerateCode(XmlReader, TextWriter, Version)

使用 XmlReader 对象中指定的概念架构定义语言(CSDL)生成对象层代码,并将生成的代码输出到 TextWriter。 请注意,targetEntityFrameworkVersion 参数使用内部 EntityFramework 版本号, EntityFrameworkVersions 如类中所述。

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。

target
TextWriter

将对象层代码写入到的 TextWriter。

targetEntityFrameworkVersion
Version

要面向的内部 Entity Framework 版本。

返回

包含任何生成的错误的对象的列表 EdmSchemaError

适用于

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

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。 架构文件路径列表用于解析 CSDL 文件中包含的任何引用。 请注意,targetEntityFrameworkVersion 参数使用内部 EntityFramework 版本号, EntityFrameworkVersions 如类中所述。

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 文件的路径。

targetPath
String

包含生成的对象层代码的文件的路径。

additionalEdmSchemaFilePaths
IEnumerable<String>

可用于解析源架构(CSDL 文件)中的任何引用的架构文件路径列表。 如果源架构没有任何依赖项,请传入空列表。

targetEntityFrameworkVersion
Version

要面向的内部 Entity Framework 版本。

返回

包含任何生成的错误的对象的列表 EdmSchemaError

适用于

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

创建一个源代码文件,其中包含从指定的概念架构定义语言 (CSDL) 文件生成的对象层代码。 请注意,targetEntityFrameworkVersion 参数使用类中所述 EntityFrameworkVersions 的内部 Entity Framework 版本号。

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。

target
TextWriter

将对象层代码写入到的 TextWriter。

additionalEdmSchemas
IEnumerable<XmlReader>

包含源架构(CSDL)引用的架构的 XmlReader 对象的列表。 如果源架构没有任何依赖项,请传入空的 IList 对象。

targetEntityFrameworkVersion
Version

要面向的内部 Entity Framework 版本。

返回

包含任何生成的错误的对象的列表 EdmSchemaError

适用于