SAP .NET 连接器 (SAPNCO) &.Net核心 [英] SAP .NET Connector (SAPNCO) & .Net Core

查看:36
本文介绍了SAP .NET 连接器 (SAPNCO) &.Net核心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SAP .NET 连接器与 .NET Core 框架不兼容.使用 .NET Core 时,还有其他方法可以从 SAP 检索数据吗?

The SAP .NET connector is not compatible with the .NET Core framework. Is there any other way to retrieve data from SAP when using .NET Core?

我已经在 nuget 包管理器中搜索了替代方案,但没有找到.我可以使用任何解决方法吗?我非常希望从 .NET Core 的性能中受益,但我还需要能够连接到 SAP.

I've allready searched for an alternative in the nuget package manager but I did not found one. Is there any workaround I can use? I would very much like to benefit from the performance of .NET Core but I also need to be able to connect to SAP.

推荐答案

为了从 .NET Core 或 .NET Framework 应用程序进行调用,我开源了一个跨平台库 SapNwRfc.

For making calls from a .NET Core or .NET Framework application, I've open-sourced a cross-platform library SapNwRfc.

NuGet 上获取:

dotnet add package SapNwRfc

PM> Install-Package SapNwRfc

优势:

  • 跨平台:Windows/Linux/macOS
  • 按惯例映射输入和输出模型(零配置)
  • 使用表达式树即时生成映射函数
  • 具有重试支持的连接池,DI 友好
  • 允许通过简单的可模拟接口进行测试驱动的开发
  • 获得麻省理工学院许可

该库已经过全面单元测试并已准备好投入生产.

The library is fully unit-tested and production ready.

string connectionString = "AppServerHost=MY_SERVER_HOST; SystemNumber=00; User=MY_SAP_USER; Password=SECRET; Client=100; Language=EN; PoolSize=5; Trace=8";

using var connection = new SapConnection(connectionString);
connection.Connect();

class SomeFunctionParameters
{
    [SapName("SOME_FIELD")]
    public string SomeField { get; set; }
}

using var someFunction = connection.CreateFunction("BAPI_SOME_FUNCTION_NAME");
someFunction.Invoke(new SomeFunctionParameters
{
    SomeField = "Some value",
});

有关详细信息,请参阅自述文件.

For more details, see the README.

这篇关于SAP .NET 连接器 (SAPNCO) &.Net核心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆