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.
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.CommonThen, 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"
}
}To use the GraphQL client, you need to add the Aviationexam.MoneyErp.Graphql package to your project:
dotnet add package Aviationexam.MoneyErp.GraphqlThen, 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;
}
}