...
Read single objects via DataContract
...
Als Eigenschafts-Filter werden die Property-Namen (oder falls vorhanden die Value des JsonPropertyAttributes) des DataContracts verwendet
...
The property names (or, if available, the value of the the JsonPropertyAttributes) of the DataContract are used as the property filter.
SDK-Method
Code Block |
---|
|
Task<TResult> IApiV2Endpoint<TId>.GetByIdAsync<TResult>(
TId id,
CancellationToken cancellationToken = default
) |
REST-Equivalent
Code Block |
---|
GET /apiv2/latest/servicedmcore/CoreIdentity/3/
?fields=Nachname,Stadt%20%2F%20Ort |
...
readonly_display_name,ci_given_name,ci_family_name,g_language |
Example-Code
Code Block |
---|
|
public class MyCoreIdentityDataContract
{
public string ReadonlyDisplayName { get; set; }
public stringAccessDeniedHandler<string> NachnameCiGivenName { get; set; }
[JsonProperty("Stadt / Ortci_family_name")]
public AccessDeniedHandler<string> FamilyName { get; set; }
[JsonProperty("g_language")]
public stringAccessDeniedHandler<IDropDownAttributeValue<int>> CityLanguage { get; set; }
}
public async Task GetCoreIdentityByIdDataContractGetCoreIdentityById()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var MyCoreIdentityDataContract item = await endpoint.GetByIdAsync<MyCoreIdentityDataContract>(3);
} |
Einzelnes Objekt via Template-Objekt lesen
Als Eigenschafts-Filter werden die Property-Namen des Template-Objektes verwendet. Abfragen für Eigenschaften welche als Property nicht gültig sind (z.B: Namen mit Leerzeichen) sind mit dieser Methode nicht möglich
SDK-Methode
...
Read single objects via template object
The property names of the template object are used as the property filter. Queries for properties which are not valid as a property (e.g. names with spaces) are not possible with this method.
SDK-Method
Code Block |
---|
|
Task<TResult> IApiV2Endpoint<TId>.GetByIdAsync<TResult>(
TId id,
TResult template,
CancellationToken cancellationToken = default
) |
REST-Equivalent
Code Block |
---|
GET /apiv2/latest/servicedmcore/CoreIdentity/3/
?fields=Nachname |
...
readonly_display_name,ci_given_name,ci_family_name,g_language |
Example-Code
Code Block |
---|
|
public async Task GetCoreIdentityByIdDynamic()
{
GetCoreIdentityById()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var item = await endpoint.GetByIdAsync(3, new
{
ReadonlyDisplayName = string.Empty,
CiGivenName = default(AccessDeniedHandler<string>),
CiFamilyName = default(AccessDeniedHandler<string>),
GLanguage = default(AccessDeniedHandler<IDropDownAttributeValue<int>>)
});
} |
Read list of objects via DataContract
The property names (or, if available, the value of the JsonPropertyAttributes) of the DataContract are used as the property filter.
SDK-Method
Code Block |
---|
|
IPagedAsyncEnumerable<TResult> IApiV2Endpoint.GetListAsync<TResult>(
Action<ListOptions<IListModifier>> options = null,
CancellationToken cancellationToken = default
); |
REST-Equivalent
No exact equivalent available because IPagedAsyncEnumerable<TResult>
carries out paging in the background and further entries are loaded if necessary.
Code Block |
---|
GET /apiv2/latest/servicedmcore/CoreIdentity
?fields=readonly_display_name,ci_given_name,ci_family_name |
Example-Code
Code Block |
---|
|
public class MyCoreIdentityDataContract
{
public string ReadonlyDisplayName { get; set; }
public AccessDeniedHandler<string> CiGivenName { get; set; }
[JsonProperty("ci_family_name")]
public AccessDeniedHandler<string> FamilyName { get; set; }
}
public async Task GetCoreIdentityList()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var items = await endpoint.GetListAsync<MyCoreIdentityDataContract>().ToArray();
} |
Read list of objects via template object
The property names of the template object are used as the property filter. Queries for properties which are not valid as a property (e.g. names with spaces) are not possible with this method.
SDK-Method
Code Block |
---|
|
IPagedAsyncEnumerable<TResult> IApiV2Endpoint.GetListAsync<TResult>(
TResult template,
Action<ListOptions<IListModifier>> options = null,
CancellationToken cancellationToken = default
); |
REST-Equivalent
No exact equivalent available because IPagedAsyncEnumerable<TResult>
carries out paging in the background and further entries are loaded if necessary.
Code Block |
---|
GET /apiv2/latest/servicedmcore/CoreIdentity
?fields=readonly_display_name,ci_given_name,ci_family_name |
Example-Code
Code Block |
---|
|
public async Task GetCoreIdentityList()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var items = await endpoint.GetListAsync(new
{
ReadonlyDisplayName = string.Empty,
CiGivenName = default(AccessDeniedHandler<string>),
CiFamilyName = default(AccessDeniedHandler<string>)
}).ToArray();
} |
Read list of objects via template object with property chains
The property names of the template object are used as the property filter. Queries for properties which are not valid as a property (e.g. names with spaces) are not possible with this method.
SDK-Method
Code Block |
---|
|
IPagedAsyncEnumerable<TResult> IApiV2Endpoint.GetListAsync<TResult>(
TResult template,
Action<ListOptions<IListModifier>> options = null,
CancellationToken cancellationToken = default
); |
REST-Equivalent
No exact equivalent available because IPagedAsyncEnumerable<TResult>
carries out paging in the background and further entries are loaded if necessary.
Code Block |
---|
GET /apiv2/latest/servicedmcore/CoreIdentity
?fields=readonly_display_name,ci_given_name,ci_family_name,core_identity_type.id |
Example-Code
Code Block |
---|
|
public async Task GetCoreIdentityList()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var itemitems = await endpoint.GetByIdAsync(3, new
{
Nachname.GetListAsync(new
{
CoreIdentityType = new
{
Id = default(AccessDeniedHandler<uint>)
},
ReadonlyDisplayName = string.Empty,
CiGivenName = default(AccessDeniedHandler<string>),
CiFamilyName = default(AccessDeniedHandler<string>)
}).ToArray();
} |
List of objects with filters
SDK-Method
Code Block |
---|
|
IPagedAsyncEnumerable<TResult> IApiV2Endpoint.GetListAsync<TResult>(
TResult template,
Action<ListOptions<IListModifier>> options = null,
CancellationToken cancellationToken = default
); |
REST-Equivalent
No exact equivalent available because IPagedAsyncEnumerable<TResult>
carries out paging in the background and further entries are loaded if necessary.
Code Block |
---|
GET /apiv2/latest/servicedmcore/CoreIdentity
?fields=readonly_display_name,ci_given_name,ci_family_name,core_identity_type.id
&filter=ci_zip_code eq 5000 |
Example-Code
Code Block |
---|
|
public async Task GetCoreIdentityList()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var items = await endpoint.GetListAsync(new
{
ReadonlyDisplayName = string.Empty,
CiGivenName = default(AccessDeniedHandler<string>),
CiFamilyName = default(AccessDeniedHandler<string>)
},
o =>
{
o.AddModifier(
new PropertyFilter
{
FilterType = FilterType.Equals,
PropertyName = "ci_zip_code",
Value = "5000"
}
);
}).ToArray();
} |