Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
var serviceCollection = new ServiceCollection(); 

var config = new DigizuiteConfiguration()
{
	BaseUrl = new Uri("https://<Digizuite url>.com/"),
	SystemUsername = "<Username>",
	SystemPassword = "<Password>"
};

serviceCollection.AddDigizuite(config)
            .AddDigizuiteLogging()
            .AddConsoleSink();
serviceCollection.AddSingleton(typeof(ILogger<>), typeof(ConsoleLogger<>));
var serviceProvider = serviceCollection.BuildServiceProvider(true);

Usecases

Get a single asset by assetId
Use the Digizuite service IAssetSearchService

Code Block
var assetSearchService = serviceProvider.GetRequiredService<IAssetSearchService>();
var assetResponse = await assetSearchService.GetAsset(75);

DC 5.8 [core api] Get assets

Get a list of assets
Use the Digizuite service IAssetSearchService

Code Block
var assetSearchService = app.Services.GetRequiredService<IAssetSearchService>();
var getAssetsRequest = new GetAssetsRequest
{
    AssetIds = new HashSet<int> { 75, 76 }
};
var assetResponse = await assetSearchService.GetAssets(getAssetsRequest);

...

Use cases:

DC 5.8 SDK Asset search

DC 5.8 SDK Asset metadata update