Skip to content

generation

Moh.Hassan edited this page Apr 23, 2019 · 1 revision

OData2Poco generate CSharp and VB.Net code from OData feeds. You can control the generated code as described in the next section.

Change Case of Poco Attributes:

Use the short option '-c' or the long option --case For camel case, enter:

         -c camel

For Pas case, enter:

         -c pas

Show/hide nullable symbol ?

     -b

This result is showing '?' for properties which is null in the schema:

	public int? Age  {get;set;}

The default, hiding the nullable option.

This option has no effect for the properties which is not null in the schema.

Show/hide navigation properties

The default is hiding the navigation properties. Passing -n option, show the navigation properties.

     -n

This result is showing the navigation properties which is defined in the schema:

This option has no effect for the properties which is not defined as a navigation in the schema.

Summary of the options used to control code generation:

 -f, --filename  (Default: poco.cs) filename to save generated c# code.

  -x, --metafile  Xml filename to save metadata.

  -b, --nullable  Add nullable data types
 
  -n, --navigationAdd navigation properties
  -e, --eager Add non virtual navigation Properties for Eager Loading
 
  -i, --inherit   for class inheritance from  BaseClass and/or interfaces

  -m, --namespace A namespace prefix for the OData namespace

  -c, --case  (Default: none) Type pas or camel to Convert Property Name to PascalCase or CamelCase

  -a, --attribute Attributes, Allowed values: key, req, json,tab,dm,proto,db,display

  --lang  (Default: cs) Type cs for CSharp, vb for VB.NET
  -g, --gen-project   Generate a class library (.Net Stnadard) project csproj/vbproj.
Clone this wiki locally