filter - moh-hassan/odata2poco GitHub Wiki
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.