Penzle.Net
2.8.1
dotnet add package Penzle.Net --version 2.8.1
NuGet\Install-Package Penzle.Net -Version 2.8.1
<PackageReference Include="Penzle.Net" Version="2.8.1" />
<PackageVersion Include="Penzle.Net" Version="2.8.1" />
<PackageReference Include="Penzle.Net" />
paket add Penzle.Net --version 2.8.1
#r "nuget: Penzle.Net, 2.8.1"
#:package Penzle.Net@2.8.1
#addin nuget:?package=Penzle.Net&version=2.8.1
#tool nuget:?package=Penzle.Net&version=2.8.1
Penzle .NET SDK
The Penzle .NET SDK is a library that allows developers to easily integrate with the Penzle Content Delivery and Content Management APIs. This SDK is designed for .NET developers who want to create, update and retrieve content from the Penzle platform.
Getting started
To install the Penzle .NET SDK, you can use the following options:
- Run the following command in the Package Manager Console:
Install-Package Penzle.Net
- Run the following .NET CLI command in the command-line:
dotnet add <your project> package Penzle.Net
Usage
To retrieve content from the Penzle APIs, you will use the DeliveryPenzleClient
class. This class provides methods for retrieving content from the Penzle Delivery API.
You will use ManagementPenzleClient
class to create, update, and delete content.
You can use a client with DI/IoC or without DI/IoC.
Without DI/IoC
var client = DeliveryPenzleClient
.Factory
(
apiDeliveryKey: "<delivery_api_key>",
(api) =>
{
api.Environment = "<environment_name>";
api.Project = "<project_name>";
}
);
With DI/IoC
public void ConfigureServices(IServiceCollection services)
{
services.AddPenzleClient(Configuration);
}
public class HomeController
{
private IDeliveryPenzleClient client;
public HomeController(IDeliveryPenzleClient deliveryPenzleClient)
{
client = deliveryPenzleClient;
}
}
Retrieving data
After creating a Penzle client, you can retrieve data from Penzle APIs:
// Retrieving a single entry by ID
var entry = await client.Entry.GetEntry<Author>(<author_id>);
Console.WriteLine(entry.Summary); // => Penzle author.
Console.WriteLine(entry.Age); // => 27.
Create a strong type model that is compatible with your data template first before you do anything else.
public sealed class Author
{
public string Summary { get; set; }
public int Age { get; set; }
}
If you need system data of the entry, add an EntrySystem property to the class.
public sealed class Author
{
public EntrySystem System { get; init; }
public string Summary { get; set; }
public int Age { get; set; }
}
The GetEntries
return collections of strongly-typed objects, based on the content types you have defined in your Penzle project.
You can use LINQ to filter, sort and transform the content before it is returned.
// Use query builder to define request parameters.
var query = QueryEntryBuilder.New
.Where(x => x.Summary.Contains("J") && x.Age >= 30)
.OrderBy(x => x.Id)
.Select(x => new { x.Id, x.FirstName });
var entries = await client.Entry.GetEntries<Author>(query: query);
// Print the entries to the console.
foreach (var entry in entries)
{
// Print the entry system fields.
Console.WriteLine(value: $"Summary {entry.Summary}");
Console.WriteLine(value: $"Age: {entry.Age}");
}
You can find complete examples in the.NET 7 console project, which is written in a "How to" approach for developers. Visit Penzle.Net.GettingStarted to view all examples of how to use various methods in console applications.
Management API
To create, update or delete data in your Penzle project, you will need to use the Penzle Management API. The Penzle .NET SDK provides a ManagementPenzleClient
class that you can use to interact with the management API:
var client = ManagementPenzleClient
.Factory
(
apiManagementKey: "<management_api_key>"
);
// Create a new instance of the form entry.
var author = new Author
{
Summary = "David Smith",
Age = 20,
};
// Create a new instance of the entry.
var medicalReleaseId = await client.Entry.CreateEntry(author, CancellationToken.None);
SDK Documentation
The official SDK documentation provides detailed information about the various classes and methods available in the SDK. Please follow the documentation for more details.
License
This SDK is released under the MIT License.
Reach out to us
We welcome feedback, bug reports, and feature requests.
If you need help with this library, please contact the vendor support.
You can also open an issue on the GitHub repository or submit a pull request with improvements to the code.
If you have any questions or suggestions, please feel free to reach out to us by sending an email to support@penzle.com.
We are looking forward to hearing from you!
Contribution
We welcome contributions to this library. If you are interested in contributing, please read the CONTRIBUTING file for more information on how to get started.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- CSharpFunctionalExtensions (>= 2.40.0)
- System.Text.Json (>= 7.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Penzle.Net:
Package | Downloads |
---|---|
Penzle.Net.Microsoft.DependencyInjection
Penzle client extensions for ASP.NET Core |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.8.1 | 479 | 10/17/2023 |
2.8.0 | 200 | 10/17/2023 |
2.7.2 | 249 | 10/11/2023 |
2.7.1 | 207 | 10/4/2023 |
2.7.0 | 180 | 10/2/2023 |
2.6.1 | 235 | 9/14/2023 |
2.6.0 | 233 | 9/7/2023 |
2.5.3 | 231 | 9/6/2023 |
2.5.2 | 221 | 9/6/2023 |
2.5.1 | 216 | 9/6/2023 |
2.5.0 | 217 | 9/5/2023 |
2.4.0 | 225 | 9/5/2023 |
2.3.1 | 228 | 8/23/2023 |
2.3.0 | 220 | 8/23/2023 |
2.3.0-beta.5 | 134 | 8/11/2023 |
2.3.0-beta.4 | 133 | 8/2/2023 |
2.3.0-beta.3 | 140 | 8/2/2023 |
2.3.0-beta.2 | 129 | 8/2/2023 |
2.3.0-beta.1 | 113 | 8/2/2023 |
2.2.0 | 217 | 7/11/2023 |
2.1.0 | 208 | 7/11/2023 |
2.0.3 | 214 | 5/12/2023 |
2.0.2 | 205 | 5/12/2023 |
2.0.1 | 334 | 3/2/2023 |
2.0.0 | 298 | 2/28/2023 |
1.1.0 | 297 | 2/28/2023 |
1.0.0-rc11 | 190 | 11/29/2022 |
1.0.0-rc10 | 210 | 11/3/2022 |
1.0.0-rc.9 | 172 | 10/26/2022 |
1.0.0-rc.8 | 175 | 10/26/2022 |
1.0.0-rc.7 | 161 | 10/26/2022 |
1.0.0-rc.6 | 153 | 10/26/2022 |
1.0.0-rc.5 | 166 | 10/25/2022 |
1.0.0-rc.4 | 160 | 10/24/2022 |