IData Api Interface
Provides methods for working with Data Objects and Data Sources.
Definition
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
C#
public interface IDataApiExample
C#
var dataApi = ctx.Use<IDataApi>();
dataApi.Add("Order", order);
Methods
| Add | Add a new Data Object. |
| AddExternalDO | Add a new external data object. |
| Any | Determines whether any element of a Data Collection exists or satisfies a condition. |
| ChangeCreator | Update the CreatedBy attribute value of an Data object |
| Clone | Clone new object and add to database. |
| Copy | Copy data from one existing data object to another. Only properties that exist in both Data Classes are copied. |
| Count | Count the Data Objects that satisfies a condition. |
| Delete | Delete a Data Object. |
| DeleteMany(DataObjectApiQuery, Boolean) | Delete multiple existing data objects based on a specified search query. |
| DeleteMany(String, Boolean) | Delete multiple existing data objects based on a specified array of data object IDs. |
| DeleteMany(DataEnumerationQuery, CancellationToken, Boolean) | Delete multiple existing data objects based on a specified enumeration data object query. |
| DumpToCsv | Enumerate a Data Source and dump the whole result set to a CSV file in the system temp folder. The file is encoded as UTF-8 (with BOM), starts with a header row and every value is safely escaped following RFC 4180. This streams the data, so it is suitable for exporting extensive collections without loading them all into memory. |
| Enumerate(DataEnumerationQuery, CancellationToken) | Query and loop through an extensive collection without writing a lot of code for data paging, Which is also inefficient when dealing with 100k+ records. |
| Enumerate(DataSourceEnumerationQuery, CancellationToken) | Query and loop through an extensive collection without writing a lot of code for data paging, Which is also inefficient when dealing with 100k+ records. |
| EscapeSearchPhrase | Escape the search phrase1. Use this method when you build the search phrase without FilterBuilder. |
| GetDataClass | Get data class by name |
| GetSchema | Load schema of a Data Source by name. This is useful for get data schema of a data source. |
| HardDelete | Remove any events and data of the data objects by their identifiers. |
| Inc | Increase value of an attribute by specified increment amount. |
| Load(String) | Load a Data Object by id. |
| Load(String, Boolean) | Force load a Data Object by id from the Database and update it to the cache. |
| Load(String, String) | Load a Data Object from a Data Source by id. This is useful for custom data loading e.g. query including related data objects. |
| Migrate(String, Object, DslMigrationOption) | Migrate an Data Object with a specified ID. This method allows add or update a data object with a specified ID without using generated ID from system. |
| Migrate(String, Object, Boolean) |
Migrate an Data Object with a specified ID.
This method allows add or update a data object with a specified ID without using generated ID from system.
Note: if canUpdateIfExist = false then the method will throw exception the specified ID already exits in DB
|
| MoveToCase | Move data object to a specific case. |
| Pull | Pull data from an array attribute. This method is thread-safe. Schema elements that are equal to the input values will be removed. |
| Push | Push data to an array attribute. This method is thread-safe. |
| Search(DataObjectApiQuery) | Search Data Objects. |
| Search(DataSourceApiQuery) | Search Data Objects from a Data Source. |
| Update | Update an existing Data Object. |
| UpdateMany(DataObjectApiQuery, Object, Boolean) | Updates multiple existing data objects based on a specified search query with patch data. |
| UpdateMany(String, Object, Boolean) | Updates multiple existing data objects based on an array of IDs with patch data. |
| UpdateMany(DataEnumerationQuery, Object, CancellationToken, Boolean) | Update multiple existing data objects based on a specified enumeration data object query with patch data. |