...
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 GetCoreIdentityById()
{
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 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 Nachname = string.Empty
default(AccessDeniedHandler<string>),
GLanguage = default(AccessDeniedHandler<IDropDownAttributeValue<int>>)
});
} |
...
Read list of 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 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
Kein exaktes equivalent vorhanden da IPagedAsyncEnumerable<TResult>
im Hintergrund ein Paging ausführt und weitere Einträge bei Bedarf nachgeladen werdenNo 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=Nachname,Stadt%20%2F%20Ort |
...
readonly_display_name,ci_given_name,ci_family_name |
Example-Code
Code Block |
---|
|
public class MyCoreIdentityDataContract
{
public string ReadonlyDisplayName { get; set; }
public stringAccessDeniedHandler<string> NachnameCiGivenName { get; set; }
[JsonProperty("Stadt / Ortci_family_name")]
public stringAccessDeniedHandler<string> CityFamilyName { get; set; }
}
public async Task GetCoreIdentityList()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var listitems = await endpoint.GetListAsync<MyCoreIdentityDataContract>().ToArray();
} |
Liste von Objekten 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
...
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
Kein exaktes equivalent vorhanden da IPagedAsyncEnumerable<TResult>
im Hintergrund ein Paging ausführt und weitere Einträge bei Bedarf nachgeladen werdenNo 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=Nachname |
...
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 listitems = await endpoint.GetListAsync(new
{
Nachname ReadonlyDisplayName = string.Empty,
CiGivenName = default(AccessDeniedHandler<string>),
CiFamilyName = default(AccessDeniedHandler<string>)
}).ToArray();
} |
Liste von Objekten via Template-Objekt mit PropertyChains 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
...
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
Kein exaktes equivalent vorhanden da IPagedAsyncEnumerable<TResult>
im Hintergrund ein Paging ausführt und weitere Einträge bei Bedarf nachgeladen werdenNo 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=Id,Nachname,CoreIdentityType.Id |
...
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 listitems = await endpoint.GetListAsync(new
{
Id = 0u,
{
CoreIdentityType = new
{
Id = default(AccessDeniedHandler<uint>)
},
ReadonlyDisplayName = string.Empty,
Id = 0u,
}
} 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
Kein exaktes equivalent vorhanden da IPagedAsyncEnumerable<TResult>
im Hintergrund ein Paging ausführt und weitere Einträge bei Bedarf nachgeladen werdenNo 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=Nachnamereadonly_display_name,ci_given_name,ci_family_name,core_identity_type.id
&filter=Stadt%20%2F%20Ortci_zip_code eq Aarau5000 |
...
Example-Code
Code Block |
---|
|
public async Task GetCoreIdentityList()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var listitems = await endpoint.GetListAsync(new
{
Nachname ReadonlyDisplayName = string.Empty,
CiGivenName }= default(AccessDeniedHandler<string>),
CiFamilyName = default(AccessDeniedHandler<string>)
},
o =>
{
o.AddModifier(
new PropertyFilter
{
{
FilterType = FilterType.Equals,
PropertyName = "Stadt / Ortci_zip_code",
Value = "Aarau5000"
}
}) );
}).ToArray();
} |