-
Notifications
You must be signed in to change notification settings - Fork 21
filter
When the model include hundereds of Entities like dynamic365 or Microsoft Graph, you may need to filter the model to generate subset of the model.
You can use the option --include <keywords>
<keywords>
can be list separated by comma.
Filter is case-insensitive and also reterive all dependent classes.
Filter is applied for both csharp and typescript code generation.
A wildcard character is used to substitute one or more characters in a string.
Wildcard characters are used with the '--include' option. The include option is used to search for a specified pattern in an Entity.
Wildcard Characters:
Symbol | Description | Example |
---|---|---|
* | Represents zero or more characters | Pro* finds Products, Products_2020 and Product_List |
? | Represents a single character | Products_202? finds Products_2021 and Products_2022 |
Odata2Poco is aware of the model dependency and when filtering the model all dependent classes are reterived also to avoid the compilation errors.
Description | syntax |
---|---|
Filter by Entity Name | --include product |
Filter for more than one Entity, use delimited values separated by space | --include product customer employee |
Filter using '*' placeholder for all characters |
--include product* cust* . Generated classes may be: Products , Products_2019 ,Customers , CustomerOrders |
Filter by Namespace |
--include myNamespace.* . Generated classes are all classes in myNamespace. Other namespaces will be excluded. |
Filter using ? placeholder for one char | --include product? |
Remarks
- Filter is case-insensitive ,e.g, product or PRODUCT or PRoducT is the same.
- Entity is the FullName: Namespace.Name, so every keyword is prefixed by * to include any namespace.
- 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: