EntityClassGenerator.GenerateCode Method

Definition

Generates a source code file that contains the objects generated from the conceptual schema definition language (CSDL) file.

Overloads

GenerateCode(String, String)

Generates a source code file that contains the objects that were generated from the specified conceptual schema definition language (CSDL) file.

GenerateCode(XmlReader, TextWriter)

Generates source code using the conceptual schema definition language (CSDL) file contained in the XmlReader object and outputs the generated source code to a TextWriter.

GenerateCode(String, String, IEnumerable<String>)

Generates source code using the specified conceptual schema definition language (CSDL) file. The list of schema file paths is used to resolve any references contained in the CSDL file.

GenerateCode(XmlReader, TextWriter, IEnumerable<XmlReader>)

Generates source code based on the conceptual schema definition language (CSDL) file in the XmlReader object, then outputs the generated source code to a TextWriter. An IList of XmlReader objects is used to resolve any references that are contained in the CSDL file.

GenerateCode(String, String)

Generates a source code file that contains the objects that were generated from the specified conceptual schema definition language (CSDL) file.

C#
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode(string sourceEdmSchemaFilePath, string targetFilePath);

Parameters

sourceEdmSchemaFilePath
String

The CSDL file path.

targetFilePath
String

The generated source code file path.

Returns

An IList of EdmSchemaError that contains any generated errors.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GenerateCode(XmlReader, TextWriter)

Generates source code using the conceptual schema definition language (CSDL) file contained in the XmlReader object and outputs the generated source code to a TextWriter.

C#
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode(System.Xml.XmlReader sourceEdmSchema, System.IO.TextWriter target);

Parameters

sourceEdmSchema
XmlReader

An XmlReader that contains the CSDL file.

target
TextWriter

The TextWriter to which the source code is written.

Returns

An IList of EdmSchemaError that contains any generated errors.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GenerateCode(String, String, IEnumerable<String>)

Generates source code using the specified conceptual schema definition language (CSDL) file. The list of schema file paths is used to resolve any references contained in the CSDL file.

C#
public System.Collections.Generic.IList<System.Data.Metadata.Edm.EdmSchemaError> GenerateCode(string sourceEdmSchemaFilePath, string targetPath, System.Collections.Generic.IEnumerable<string> additionalEdmSchemaFilePaths);

Parameters

sourceEdmSchemaFilePath
String

The CSDL file path.

targetPath
String

The generated source code file path.

additionalEdmSchemaFilePaths
IEnumerable<String>

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.

Returns

An IList of EdmSchemaError objects that contains any generated errors.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GenerateCode(XmlReader, TextWriter, IEnumerable<XmlReader>)

Generates source code based on the conceptual schema definition language (CSDL) file in the XmlReader object, then outputs the generated source code to a TextWriter. An IList of XmlReader objects is used to resolve any references that are contained in the CSDL file.

C#
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);

Parameters

sourceEdmSchema
XmlReader

An XmlReader that contains the CSDL file.

target
TextWriter

The TextWriter to which you want to output the generated source code.

additionalEdmSchemas
IEnumerable<XmlReader>

The list of XmlReader objects that contain schemas that are referenced by the source schema (the CSDL file). If the source schema does not have any dependencies, pass in an empty IList object.

Returns

A list of EdmSchemaError objects that contains any generated errors.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1