Skip to content

feat(bindings/dotnet): Bindings dotnet implement#7238

Open
Fatorin wants to merge 11 commits intoapache:mainfrom
Fatorin:bindings-dotnet-implement
Open

feat(bindings/dotnet): Bindings dotnet implement#7238
Fatorin wants to merge 11 commits intoapache:mainfrom
Fatorin:bindings-dotnet-implement

Conversation

@Fatorin
Copy link
Contributor

@Fatorin Fatorin commented Mar 6, 2026

Which issue does this PR close?

Closes #2428.

Rationale for this change

This PR adds the Apache OpenDAL .NET binding together with its testing and CI integration.

The binding provides a .NET-friendly API built on top of the OpenDAL Rust core via FFI, allowing .NET applications to access OpenDAL services using familiar .NET patterns such as async/await, Stream, and IDisposable.

In addition to the core binding implementation, this PR also introduces behavior-test integration for the .NET binding and separates regular binding tests from backend behavior tests in CI, following the testing model already used by other language bindings.

What changes are included in this PR?

  • Implement the initial .NET binding for OpenDAL.
  • Provide Operator APIs covering common object operations, including read, write, stat, list, delete, copy, rename, create dir, remove all, and presign operations.
  • Add async APIs using Task.
  • Implement .NET Stream wrappers (OperatorInputStream, OperatorOutputStream).
  • Add service configuration support, including scheme + dictionary options and typed configs.
  • Implement operation options (ReadOptions, WriteOptions, ListOptions, StatOptions).
  • Add layer support (RetryLayer, TimeoutLayer, ConcurrentLimitLayer).
  • Implement error mapping via OpenDALException and ErrorCode.
  • Add README documentation and usage examples for the .NET binding.
  • Add .NET behavior tests for core operator behaviors.
  • Add behavior test workflow integration for the .NET binding.
  • Separate regular .NET binding tests and behavior tests in CI so they are executed independently.

Are there any user-facing changes?

Yes.

This PR introduces the Apache OpenDAL .NET binding, allowing .NET users to interact with OpenDAL services through a native .NET API.

It also adds documentation and examples for using the binding.

AI Usage Statement

AI tools were used to assist with development exploration, code implementation, and documentation drafting.
All code and changes were manually reviewed and validated before submission.

AI version used: GitHub Copilot (Codex 5.2)

@Fatorin Fatorin requested review from Xuanwo and tisonkun as code owners March 6, 2026 18:01
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Mar 6, 2026
@Fatorin Fatorin changed the title Bindings dotnet implement feat(bindings/dotnet): Bindings dotnet implement Mar 6, 2026
run: |
cargo build
dotnet test -f ${{ matrix.dotnet-version == '8.0.x' && 'net8.0' || 'net10.0' }}
dotnet test --filter "FullyQualifiedName!~Behavior" -f ${{ matrix.dotnet-version == '8.0.x' && 'net8.0' || 'net10.0' }}
Copy link
Member

@tisonkun tisonkun Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FullyQualifiedName~Behavior is for Test Binding Dotnet. [test_behavior_binding_dotnet/action.yaml]

FullyQualifiedName!~Behavior is for Bindings Dotnet CI. [ci_bindings_dotnet.yml]

one for behavior/integration coverage, and one for normal CI coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored the test cases make the structure clearer and simplify the CI test commands.

Fatorin added 3 commits March 9, 2026 00:45
…mands

- Migrate legacy Fs/Memory operator coverage into behavior-oriented tests.
- Add additional sync/async parity cases across behavior test suites.
- Introduce OperatorBehaviorTest for shared operator scenarios (info, duplicate,
  stream roundtrip, and cancellation resilience).
- Remove obsolete FsOperatorTest and MemoryOperatorTest after migration.
- Simplify Dotnet CI test invocation by using OPENDAL_TEST=memory and a unified
  `dotnet test` command.
- Simplify behavior binding action test command to reduce filter confusion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenDAL C# bindings

2 participants