Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel2

...

Read single objects via DataContract

...

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
languagec#
Task<TResult> IApiV2Endpoint<TId>.GetByIdAsync<TResult>(
  TId id, 
  CancellationToken cancellationToken = default
)

REST-Equivalent

Code Block
GET /apiv2/servicedmcore/CoreIdentity/3/
?fields=readonly_display_name,ci_given_name,ci_family_name

...

Example-Code

Code Block
languagec#
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 GetCoreIdentityById()
{
	var api = GetService<IApiV2Client>();
	var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
	var 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.

...

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
languagec#
Task<TResult> IApiV2Endpoint<TId>.GetByIdAsync<TResult>(
  TId id, 
  TResult template, 
  CancellationToken cancellationToken = default
)

REST-Equivalent

Code Block
GET /apiv2/servicedmcore/CoreIdentity/3/
?fields=readonly_display_name,ci_given_name,ci_family_name

...

Example-Code

Code Block
languagec#
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 = default(AccessDeniedHandler<string>)
	});
}

...

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
languagec#
IPagedAsyncEnumerable<TResult> IApiV2Endpoint.GetListAsync<TResult>(
  Action<ListOptions<IListModifier>> options = null, 
  CancellationToken cancellationToken = default
);

REST-Equivalent

Kein exaktes Äquivalent 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/servicedmcore/CoreIdentity
?fields=readonly_display_name,ci_given_name,ci_family_name

...

Example-Code

Code Block
languagec#
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();
}

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
languagec#
IPagedAsyncEnumerable<TResult> IApiV2Endpoint.GetListAsync<TResult>(
  TResult template, 
  Action<ListOptions<IListModifier>> options = null, 
  CancellationToken cancellationToken = default
);

REST-Equivalent

Kein exaktes Äquivalent 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/servicedmcore/CoreIdentity
?fields=readonly_display_name,ci_given_name,ci_family_name

...

Example-Code

Code Block
languagec#
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();
}

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
languagec#
IPagedAsyncEnumerable<TResult> IApiV2Endpoint.GetListAsync<TResult>(
  TResult template, 
  Action<ListOptions<IListModifier>> options = null, 
  CancellationToken cancellationToken = default
);

REST-Equivalent

Kein exaktes Äquivalent 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/servicedmcore/CoreIdentity
?fields=readonly_display_name,ci_given_name,ci_family_name,core_identity_type.id

...

Example-Code

Code Block
languagec#
public async Task GetCoreIdentityList()
{
	var api = GetService<IApiV2Client>();
	var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
	var items = await endpoint.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
languagec#
IPagedAsyncEnumerable<TResult> IApiV2Endpoint.GetListAsync<TResult>(
  TResult template, 
  Action<ListOptions<IListModifier>> options = null, 
  CancellationToken cancellationToken = default
);

REST-Equivalent

Kein exaktes Äquivalent 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/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
languagec#
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();
}

...