Skip to content

aviationexam/Aviationexam.MoneyErp

Repository files navigation

Build Status Build Status - DevOps

Aviationexam.MoneyErp.Common

NuGet feedz.io

Aviationexam.MoneyErp.Graphql

NuGet feedz.io

Aviationexam.MoneyErp Clients

This repository contains .NET clients for interacting with the Money ERP system, a popular accounting and business management software in the Czech Republic and Slovakia. The clients provide convenient access to the GraphQL API of Money ERP.

Getting Started

To get started, you need to add the desired client library to your project and configure the necessary services in your dependency injection container.

First, add the core package to your project:

dotnet add package Aviationexam.MoneyErp.Common

Then, in your Program.cs or Startup.cs, configure the Money ERP services:

using Aviationexam.MoneyErp.Common.Extensions;

// ...

builder.Services.AddMoneyErp(
    options => options.Configure(builder.Configuration.GetSection("MoneyErp"))
);

This will configure the basic services required for authentication and communication with the Money ERP API. The configuration section in your appsettings.json should look like this:

{
  "MoneyErp": {
    "Endpoint": "https://your-money-erp-endpoint",
    "ClientId": "your-client-id",
    "ClientSecret": "your-client-secret"
  }
}

GraphQL Client

To use the GraphQL client, you need to add the Aviationexam.MoneyErp.Graphql package to your project:

dotnet add package Aviationexam.MoneyErp.Graphql

Then, chain the AddGraphQlClient method to the AddMoneyErp call:

using Aviationexam.MoneyErp.Graphql.Extensions;

// ...

builder.Services.AddMoneyErp(
    options => options.Configure(builder.Configuration.GetSection("MoneyErp"))
)
.AddGraphQlClient(
    options => options.Configure(builder.Configuration.GetSection("MoneyErp"))
);

Now you can inject MoneyErpGraphqlClient into your services and use it to make GraphQL queries:

public class MyService(MoneyErpGraphqlClient graphqlClient)
{
    public async Task<string> GetMoneyErpVersion()
    {
        var version = await graphqlClient.Query(x => x.Version);
        return version.Data;
    }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages