AtlasCMS 0.0.1
See the version list below for details.
dotnet add package AtlasCMS --version 0.0.1
NuGet\Install-Package AtlasCMS -Version 0.0.1
<PackageReference Include="AtlasCMS" Version="0.0.1" />
paket add AtlasCMS --version 0.0.1
#r "nuget: AtlasCMS, 0.0.1"
// Install AtlasCMS as a Cake Addin #addin nuget:?package=AtlasCMS&version=0.0.1 // Install AtlasCMS as a Cake Tool #tool nuget:?package=AtlasCMS&version=0.0.1
This is the Atlas Headless CMS .NET Client SDK
Getting started
We recommend you use the NuGet Package Manager to add the library to your .NET Application using one of the following options:
In Visual Studio, open Package Manager Console window and run the following command:
PM> Install-Package [STILL TO DEFINE]
In a command-line, run the following .NET CLI command:
> dotnet add package [STILL TO DEFINE]
Use the Client
var options = new AtlasOptions
{
BaseUrl = "<Atlas CMS Base Url>",
ApiKey = "<Your Api Key or Token>"
};
var client = new AtlasClient(options);
Now you can use all the features exposed by the client. For Example if you want to read a content you can
var myContent = await client.GetContent<object>("<model-api-key>", "<content-id>");
The above request will return a object of type Content<object>
where its definition is the following:
public class Content<T> where T : class
{
public string Id { get; set; }
public string Locale { get; set; }
public DateTime CreatedAt { get; private set; }
public string ModelId { get; private set; }
public string ModelKey { get; private set; }
public string CreatedBy { get; private set; }
public DateTime ModifiedAt { get; private set; }
public string ModifiedBy { get; private set; }
public string Hash { get; private set; }
public T Attributes { get; set; }
public List<ContentLocale> Locales { get; private set; } = new List<ContentLocale>();
}
Strongly Typed Attributes
Each Content in Atlas has Attributes that are the dynamic values based on the Model. If you don't want to work with objects you can create your own class that match the Model Field keys in Atlas and use it. For example, if you created in Atlas a Model called Book with the following keys:
- Title (text)
- ISBN (text)
- NumberOfPages (num int)
- Tags (array of strings)
you can use the following approach:
public class Book
{
public string Title { get; set; }
public string ISBN { get; set; }
public int NumberOfPages { get; set; }
public string[] Tags { get; set; }
}
var myBook = await client.GetContent<Book>("<model-api-key>", "<content-id>");
Now in the Attribute property of the Content<Book>
you can use your strongly typed class.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
- RestSharp (>= 108.0.1)
- RestSharp.Serializers.NewtonsoftJson (>= 108.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.2 | 469 | 9/15/2022 |
0.1.1 | 395 | 9/13/2022 |
0.1.0 | 391 | 8/30/2022 |
0.0.4-Preview | 157 | 8/22/2022 |
0.0.3-Preview | 156 | 8/14/2022 |
0.0.2 | 421 | 8/13/2022 |
0.0.1 | 406 | 8/13/2022 |