forked from simplefx/Simple.OData
-
Notifications
You must be signed in to change notification settings - Fork 192
Simple.OData.Client basic API
Jason Finch edited this page Aug 23, 2018
·
11 revisions
Simple.OData.Client has two APIs that can be used to retrieve and modify OData resources: basic and fluent. Each of APIs provides full set of OData protocol operations, so choice of the API depends on client application design and personal developer's preferences. Basic API consists of methods defined in ODataClient class:
Retrieve data:
public async Task<IEnumerable<IDictionary<string, object>>> FindEntriesAsync(string commandText);
public async Task<IEnumerable<IDictionary<string, object>>> FindEntriesAsync(string commandText, bool scalarResult);
public async Task<IEnumerable<IDictionary<string, object>>> FindEntriesAsync(string commandText, out int totalCount);
public async Task<IEnumerable<IDictionary<string, object>>> FindEntriesAsync(string commandText, bool scalarResult, out int totalCount);
public async Task<IDictionary<string, object>> FindEntryAsync(string commandText);
public async Task<object> FindScalarAsync(string commandText);
public async Task<IDictionary<string, object>> GetEntryAsync(string collection, params object[] entryKey);
public async Task<IDictionary<string, object>> GetEntryAsync(string collection, IDictionary<string, object> entryKey);
Insert data:
public async Task<IDictionary<string, object>> InsertEntryAsync(string collection, IDictionary<string, object> entryData, bool resultRequired = true);
Update data:
public async Task<int> UpdateEntriesAsync(string collection, string commandText, IDictionary<string, object> entryData);
public async Task<int> UpdateEntryAsync(string collection, IDictionary<string, object> entryKey, IDictionary<string, object> entryData);
Delete data:
public async Task<int> DeleteEntriesAsync(string collection, string commandText);
public async Task<int> DeleteEntryAsync(string collection, IDictionary<string, object> entryKey);
Manage relationships:
public async Task LinkEntryAsync(string collection, IDictionary<string, object> entryKey, string linkName, IDictionary<string, object> linkedEntryKey);
public async Task UnlinkEntryAsync(string collection, IDictionary<string, object> entryKey, string linkName);
Execute functions:
public async Task<IEnumerable<IDictionary<string, object>>> ExecuteFunctionAsync(string functionName, IDictionary<string, object> parameters);
public async Task<T> ExecuteFunctionAsScalarAsync(string functionName, IDictionary<string, object> parameters);
public async Task<T[]> ExecuteFunctionAsScalarAsync(string functionName, IDictionary<string, object> parameters);
See also:
Simple.OData.Client fluent API
Getting started with Simple.OData.Client