Opacc.Client 0.4.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Opacc.Client --version 0.4.0
                    
NuGet\Install-Package Opacc.Client -Version 0.4.0
                    
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="Opacc.Client" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Opacc.Client" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Opacc.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Opacc.Client --version 0.4.0
                    
#r "nuget: Opacc.Client, 0.4.0"
                    
#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.
#:package Opacc.Client@0.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Opacc.Client&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Opacc.Client&version=0.4.0
                    
Install as a Cake Tool

Opacc.Client

A typed .NET client for the Opacc ERP WebService (OXAS). Provides a strongly-typed API over the generic Opacc WCF endpoint for reading, querying and writing Business Objects, with dependency-injection integration and a bundled Roslyn analyzer that validates your BO model classes at compile time.

Installation

<PackageReference Include="Opacc.Client" Version="*" />

Quick start

Configure programmatically:

services.AddOpaccClient(options =>
{
    options.ServiceUrl      = "YourOpaccWebserviceUrl";
    options.ClientId        = "1";
    options.ApplicationId   = "MyApp";
    options.DefaultUserId   = "100";
    options.DefaultPassword = "...";
});

…or bind from configuration (appsettings.json, User Secrets, environment variables):

// appsettings.json → "Opacc": { "ServiceUrl": "...", "ClientId": "1", ... }
// Keep DefaultPassword out of source control — use User Secrets or an env var.
services.AddOpaccClient(builder.Configuration.GetSection("Opacc"));

The Opacc config section uses the same keys as OpaccClientOptions, so the same file also feeds the opacc scaffolding CLI.

Inject IOpaccClient (or the lower-level IOpaccTransport) wherever you need it.

Builders vs. awaitables

The operation entry points return builders, not tasks. Only the closing call actually sends the request, and only it is awaitable — which is why only it carries an Async suffix:

var addr = await client.GetBo<Addr>().Start(1001).FirstAsync();
//               ^ builder, not awaitable          ^ sends the request
Entry point Closing call
GetBo<T>() / Query<T>() FirstAsync(), ToListAsync(), ToPageAsync()
SaveBo<T>() / DeleteBo<T>() / Raw(...) ExecuteAsync()

Deprecated: these entry points used to be called GetBoAsync<T>(), QueryAsync<T>(), SaveBoAsync<T>() and DeleteBoAsync<T>(). The suffix was misleading — they never returned an awaitable. The old names still work but emit a compiler warning and are removed in v1.0; drop the Async to migrate.

Service calls

Besides the BO operations (GetBo, Query, SaveBo, DeleteBo) you can call any Opacc service on any port:

// named parameters → ["ArtNo=10100", "CustNo=1001"]
var r = await client.SendRawAsync(OpaccService.ArtSal_GetPrice, new { ArtNo = "10100", CustNo = 1001 });
var price = r.Scalar;

// positional parameters, taken from a scaffolded (or hand-written) request class
var r2 = await client.SendAsync(new ArtSal_GetPriceRequest { ArtNo = "10100", CustNo = 1001 });

Which convention applies is dictated by the operation, not by preference. For services without a scaffolded constant, construct the id directly: new OpaccServiceId("MyPort", "MyOperation").

Raw(...) is the fluent form for everything the two shorthands cannot express — above all a different user (see below) and a verbatim parameter array:

var r = await client.Raw(new OpaccServiceId("MyPort", "MyOperation"))
    .Parameters(["10100", "", "1001"])
    .ExecuteAsync();

Running a request as a different user

Every operation runs under DefaultUserId unless told otherwise. WithCredentials switches a single request to a user-specific session:

await client.GetBo<Addr>().Start(1001).WithCredentials(4711, "secret").FirstAsync();
await client.Raw(OpaccService.ArtSal_GetPrice).Parameters(new { ArtNo = "10100" })
    .WithCredentials(4711, "secret").ExecuteAsync();

Sessions are pooled per user and reused until they expire (SessionTimeout) or go idle (UserSessionIdleTimeout); at most MaxUserSessions user sessions exist at a time.

  • Opacc.Client.Sentry — Sentry performance tracing for every Opacc operation.
  • Opacc.Client.CLI (opacc) — a dotnet tool that scaffolds C# model classes from a live Opacc instance.

Analyzer

This package ships a Roslyn analyzer (analyzers/dotnet/cs) that runs automatically once installed — no extra reference required. It validates [Bo] / [BoProperty] model definitions and reports common mapping mistakes as build diagnostics.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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