API-V2 C#_SDK Read objects
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
Task<TResult> IApiV2Endpoint<TId>.GetByIdAsync<TResult>(
TId id,
CancellationToken cancellationToken = default
)
REST-Equivalent
GET /apiv2/latest/servicedmcore/CoreIdentity/3/
?fields=readonly_display_name,ci_given_name,ci_family_name,g_language
Example-Code
public class MyCoreIdentityDataContract
{
public string ReadonlyDisplayName { get; set; }
public AccessDeniedHandler<string> CiGivenName { get; set; }
[JsonProperty("ci_family_name")]
public AccessDeniedHandler<string> FamilyName { get; set; }
[JsonProperty("g_language")]
public AccessDeniedHandler<IDropDownAttributeValue<int>> Language { get; set; }
}
public async Task GetCoreIdentityById()
{
var api = GetService<IApiV2Client>();
var endpoint = api.DmcoreService.Servicedmcore.CoreIdentity;
var item = await endpoint.GetByIdAsync<MyCoreIdentityDataContract>(3);
}
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
REST-Equivalent
Example-Code
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
REST-Equivalent
No exact equivalent available because IPagedAsyncEnumerable<TResult>
carries out paging in the background and further entries are loaded if necessary.
Example-Code
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
REST-Equivalent
No exact equivalent available because IPagedAsyncEnumerable<TResult>
carries out paging in the background and further entries are loaded if necessary.
Example-Code
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
REST-Equivalent
No exact equivalent available because IPagedAsyncEnumerable<TResult>
carries out paging in the background and further entries are loaded if necessary.
Example-Code
List of objects with filters
SDK-Method
REST-Equivalent
No exact equivalent available because IPagedAsyncEnumerable<TResult>
carries out paging in the background and further entries are loaded if necessary.
Example-Code
© ITSENSE AG. Alle Rechte vorbehalten. ITSENSE und CoreOne sind eingetragene Marken der ITSENSE AG.