Data models are the entities in your project.
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.
dotnet occli.dll model add --project MyProject --name Product --description "Product data model" --label Product
All of the created model for a project can be viewed using the list
command:
dotnet occli.dll model list --project MyProject
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
dotnet occli.dll model update --project MyProject --name Product --rename Item --description "Item data model" --label Item
Remove a data model by specifying the project name and data model name to be removed:
dotnet occli.dll model remove --project MyProject --name Product
Add new property of a data model by specifying the project name, data model name, and property name.
dotnet occli.dll property add --project MyProject --model Product --name Price
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:
dotnet occli.dll property add --project MyProject --model Product --name Price --type int --controltype input-number
Lastly, you can add a relational property, if you want to relate a model to another model:
dotnet occli.dll property add --project MyProject --model Product --name Tags --relational Tag --relationaltype one-to-many
All of the created property for a model can be viewed using the list
command:
dotnet occli.dll property list --project MyProject --model Product
You can update a property by specifying the project name, data model name, and property name, then specify the new value for other options:
dotnet occli.dll property add --project MyProject --model Product --name Price --type decimal --controltype input-number
Remove a data model by specifying the project name, data model name, and the property name to be removed:
dotnet occli.dll property remove --project MyProject --model Product --name Price
Data types of data model property:
string
int
short
float
double
decimal
bool
datetime
byte
guid
dbgeography
Control types of data model property:
input-text
input-number
input-file
textarea
checkbox
select
radio
calendar
image
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.