Advanced Topics
Once you have written your first service with Azure.Core
, you might be interested to try the following features:
Defining singleton resources
You can define a singleton resource (a resource type with only one instance) by using a string literal for the key type. Imagine we want to expose an analytics endpoint for each Widget
instance. Hereβs what it would look like:
You can then use the standard operation signatures with this singleton resource type:
By using a literal value of "current"
for "id"
, the route path for these operations will be the following:
The operations defined against this singleton resource will also exclude the key parameter because it cannot be changed.