It helps you to use microCMS from C# applications.(unofficial)
Install-Package microCMS.SDK -Version 2.0.0
dotnet add package microCMS.SDK --version 2.0.0
First, create a client.
using microCMS.SDK.Client;
using microCMS.SDK.Query;
public class Sample
{
public void Get()
{
var client = new MicroCMSClient(serviceDomain, apiKey);
}
}
After, How to use it below.
Need to add JsonProperty attribute for deserialization.
using Newtonsoft.Json;
using microCMS.SDK;
public class Category : MicroCMSListContent
{
[JsonProperty("name")]
public string Name { get; set; }
}
using microCMS.SDK.Client;
using microCMS.SDK.Query;
public class Sample
{
public void Get()
{
var client = new MicroCMSClient(serviceDomain, apiKey);
// Response is deserialized to generic type parameter `T`.
var response = client.GetList<Category>(new GetListRequest()
{
Endpoint = "categories"
}).Result;
}
}
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.