Mono.Core
0.0.4
See the version list below for details.
dotnet add package Mono.Core --version 0.0.4
NuGet\Install-Package Mono.Core -Version 0.0.4
<PackageReference Include="Mono.Core" Version="0.0.4" />
paket add Mono.Core --version 0.0.4
#r "nuget: Mono.Core, 0.0.4"
// Install Mono.Core as a Cake Addin #addin nuget:?package=Mono.Core&version=0.0.4 // Install Mono.Core as a Cake Tool #tool nuget:?package=Mono.Core&version=0.0.4
Mono.Core
Mono.Core is a .NET library that provides services and utilities for Mono accounts management. This library includes extension methods for IServiceCollection
to easily configure and add Mono services to your application.
Configuration
MonoInitializationOptions
The MonoInitializationOptions
class is used to configure the Mono services. You can configure the following options:
BaseUrl
: The base URL of the Mono API. Default ishttps://api.withmono.com
.SecretKey
: The secret key used to authenticate requests to the Mono API.
services.AddMono(options =>
{
options.BaseUrl = "https://api.withmono.com";
options.SecretKey = "your_secret_key";
});
Installation
To install Mono.Core, you can use the NuGet package manager:
dotnet add package Mono.Core
Usage Adding Mono Services To add Mono services to your IServiceCollection, use the AddMono extension method. This method configures the necessary services and dependencies for Mono.
Usage
Adding Mono Services
To add all Mono services including accounts, statements, authorization etc. to your IServiceCollection
, use the AddMono
extension method. This method configures the necessary services and dependencies for Mono.
using Microsoft.Extensions.DependencyInjection;
using Mono.Core;
services.AddMono(options =>
{
// Configure MonoInitializationOptions here
});
Adding Mono Services Individually
You can also add Mono services individually by calling the AddMonoAccounts
, AddMonoStatements
, AddMonoAuthorization
, etc. extension methods.
using Microsoft.Extensions.DependencyInjection;
using Mono.Core;
services.AddMonoAccounts(options =>
{
// Configure MonoAccountsOptions here
});
services.AddMonoStatements(options =>
{
// Configure MonoStatementsOptions here
});
services.AddMonoAuthorization(options =>
{
// Configure MonoAuthorizationOptions here
});
Usage in business logic
Once you have added the Mono services to your IServiceCollection
, you can inject the services into your business logic classes and use them to interact with the Mono API.
using Mono.Core.Accounts;
public class YourService
{
private readonly IMonoAccountsService _accountsService;
public YourService(IMonoAccountsService accountsService)
{
_accountsService = accountsService;
}
public async Task GetAccounts()
{
var accounts = await _accountsService.GetAccountsAsync();
// Do something with the accounts
}
}
Accepting webhooks from Mono
To package includes a predefined controller that you can use to accept webhooks from Mono. To use the controller, add your webhook URL to the Mono dashboard and as follows:
https://yourdomain.com/api/MonoWebhook/receive
Then you need to create a class that inherits the IMonoWebhookHandler interface and implement all missing methods.
using Mono.Core.Webhooks;
public class YourMonoWebhookHandler : IMonoWebhookConsumer
{
public async Task HandleAccountCreatedEvent(AccountConnectedEventModel webhook)
{
// Handle the webhook
}
public async Task HandleAccountUpdatedEvent(AccountUpdatedEventModel webhook)
{
// Handle the webhook
}
public async Task HandleUnknownEvent(AccountDeletedEventModel webhook)
{
// Handle the webhook
}
}
Contributing
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
License
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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.0
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- Moq (>= 4.20.70)
- Newtonsoft.Json.Bson (>= 1.0.3-beta1)
- Refit (>= 7.1.2)
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 |
---|---|---|
1.0.15 | 94 | 10/24/2024 |
1.0.14 | 100 | 10/20/2024 |
1.0.13 | 104 | 9/24/2024 |
1.0.12 | 85 | 9/24/2024 |
1.0.11 | 91 | 9/24/2024 |
1.0.10 | 90 | 9/24/2024 |
1.0.9 | 86 | 9/24/2024 |
1.0.8 | 102 | 9/16/2024 |
1.0.7 | 99 | 9/15/2024 |
1.0.6 | 87 | 9/13/2024 |
1.0.5 | 87 | 9/13/2024 |
1.0.4 | 171 | 8/22/2024 |
1.0.3 | 115 | 8/20/2024 |
1.0.2 | 115 | 8/20/2024 |
1.0.1 | 137 | 8/12/2024 |
1.0.0 | 80 | 8/6/2024 |
0.0.4 | 77 | 7/23/2024 |
0.0.3 | 74 | 7/23/2024 |
0.0.2 | 76 | 7/23/2024 |
0.0.1 | 79 | 7/22/2024 |