-
Notifications
You must be signed in to change notification settings - Fork 21
AttributeExamples
moh-hassan edited this page Mar 1, 2021
·
1 revision
The option -a max
generte the next attribute based on the metadata:
[MaxLength(26)]
public string LastName {get;set;}
The option -a key
generte the next attribute based on the metadata:
[Key]
public string UserName {get;set;} //PrimaryKey not null
The option -a req
generte the next attribute based on the metadata:
[Required]
public string LastName {get;set;}
The option -a json
generte the next attribute based on the metadata:
[JsonProperty(PropertyName = "UserName")]
public string UserName {get;set;} //PrimaryKey not null
The option -a dm
generte the next attribute based on the metadata:
[DataMember]
public string UserName {get;set;} //PrimaryKey not null
The option -a proto
generte the next attribute based on the metadata:
[ProtoMember(1)]
public string UserName {get;set;} //PrimaryKey not null
The option -a display
generte the next attribute based on the metadata:
[Display(Name = "User Name")]
public string UserName {get;set;} //PrimaryKey not null
The option -a json3
generte the next json attribute of Text.Json of Necore3.x or Net5 based on the metadata:
[JsonPropertyName("Location")]
public AirportLocation Location {get;set;}
Note:
You can pass multiple attributes searated by space and get the corresponding attributes based on the metadata, e.g
-a key json max
- home
- Announcing V6.0.0
- Features
- Getting started with c# generation
- Http Connection
- Using Parameter file
- User Defined Attributes
- Controlling c# code generation
- Model Filter
- Enable Nullable Reference type of c# 8
- Class with Init-Only Properties (c# 9)
- Generating Constructor
- Record-Type (c# 9)
- Name Map
- Securing Password
- Using Proxy Server
- Using Plugin Attributes
- Developing with OData2Poco
- Examples in dotnetfiddle.net
- CommandLine-Reference
- AttributeExamples
- typescript generation
- Help Screen
- How to
- New Feature 4.2.1
Samples of generated code: