Manage data models
Data models are the entities in your project.

Add data model

Add new data model by specifying the project name and the new data model name. You can also specify the description and label of the data model.
1
dotnet occli.dll model add --project MyProject --name Product --description "Product data model" --label Product
Copied!
All of the created model for a project can be viewed using the list command:
1
dotnet occli.dll model list --project MyProject
Copied!

Update data model

You can update adata model by specifying the project name and the new data model name, then specify the new name or other options to be updated
1
dotnet occli.dll model update --project MyProject --name Product --rename Item --description "Item data model" --label Item
Copied!

Remove data model

Remove a data model by specifying the project name and data model name to be removed:
1
dotnet occli.dll model remove --project MyProject --name Product
Copied!

Add data model property

Add new property of a data model by specifying the project name, data model name, and property name.
1
dotnet occli.dll property add --project MyProject --model Product --name Price
Copied!
If not set, the data type is set to string, and the control type is set to input-text. You can optionally set them if you want to change to another type:
1
dotnet occli.dll property add --project MyProject --model Product --name Price --type int --controltype input-number
Copied!
Lastly, you can add a relational property, if you want to relate a model to another model:
1
dotnet occli.dll property add --project MyProject --model Product --name Tags --relational Tag --relationaltype one-to-many
Copied!
All of the created property for a model can be viewed using the list command:
1
dotnet occli.dll property list --project MyProject --model Product
Copied!

Update data model property

You can update a property by specifying the project name, data model name, and property name, then specify the new value for other options:
1
dotnet occli.dll property add --project MyProject --model Product --name Price --type decimal --controltype input-number
Copied!

Remove data model property

Remove a data model by specifying the project name, data model name, and the property name to be removed:
1
dotnet occli.dll property remove --project MyProject --model Product --name Price
Copied!

Data model property type

Data types of data model property:
    string
    int
    short
    float
    double
    decimal
    bool
    datetime
    byte
    guid
    dbgeography

Data model property control type

Control types of data model property:
    input-text
    input-number
    input-file
    textarea
    checkbox
    select
    radio
    calendar
    image

Data model property relationship

Types of data model relationship:
    one-to-one: The property is related to one object instance of the related model
    one-to-many: The property contains list of object instances of the related model
    many-to-many: The property contains list of object instances of the related model, and the related model may also have list of object instances of the current model.
Last modified 3yr ago