Mono.Core 0.0.4

There is a newer version of this package available.
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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mono.Core" Version="0.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mono.Core --version 0.0.4                
#r "nuget: Mono.Core, 0.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 is https://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

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 119 10/24/2024
1.0.14 125 10/20/2024
1.0.13 113 9/24/2024
1.0.12 95 9/24/2024
1.0.11 102 9/24/2024
1.0.10 98 9/24/2024
1.0.9 94 9/24/2024
1.0.8 110 9/16/2024
1.0.7 107 9/15/2024
1.0.6 99 9/13/2024
1.0.5 96 9/13/2024
1.0.4 180 8/22/2024
1.0.3 124 8/20/2024
1.0.2 123 8/20/2024
1.0.1 145 8/12/2024
1.0.0 88 8/6/2024
0.0.4 85 7/23/2024
0.0.3 84 7/23/2024
0.0.2 90 7/23/2024
0.0.1 87 7/22/2024