CommunityToolkit.Datasync.Server.MongoDB
10.2.0
Prefix Reserved
dotnet add package CommunityToolkit.Datasync.Server.MongoDB --version 10.2.0
NuGet\Install-Package CommunityToolkit.Datasync.Server.MongoDB -Version 10.2.0
<PackageReference Include="CommunityToolkit.Datasync.Server.MongoDB" Version="10.2.0" />
<PackageVersion Include="CommunityToolkit.Datasync.Server.MongoDB" Version="10.2.0" />
<PackageReference Include="CommunityToolkit.Datasync.Server.MongoDB" />
paket add CommunityToolkit.Datasync.Server.MongoDB --version 10.2.0
#r "nuget: CommunityToolkit.Datasync.Server.MongoDB, 10.2.0"
#:package CommunityToolkit.Datasync.Server.MongoDB@10.2.0
#addin nuget:?package=CommunityToolkit.Datasync.Server.MongoDB&version=10.2.0
#tool nuget:?package=CommunityToolkit.Datasync.Server.MongoDB&version=10.2.0
🧰 Datasync Toolkit
The Datasync Community Toolkit is a collection of libraries that implement a client-server system used for synchronizing data from the database table. The Datasync Community Toolkit is a member of the Community Toolkit organization and published under the dotnet Foundation.
Currently, the library supports:
- Server: ASP.NET Core 10.x or later
- Client: .NET clients using .NET 10.x or later
The client platforms that have been tested include:
- Avalonia UI
- Blazor WASM
- .NET MAUI
- Uno Platform
- Windows Presentation Framework (WPF)
- Windows UI Library (WinUI) 3
We support most databases that are supported by Entity Framework Core, along with an in-memory store and LiteDb. Support for additional database types is easily added through our flexible repository pattern.
Other platforms may work, but have not been tested.
🙌 Getting Started
Please take a look at the tutorials included in our documentation.
You can easily get started by using the dotnet new command to create a new datasync server. The template pre-configured ASP.NET Core, Entity Framework Core, and the Datasync server libraries. To install the template:
dotnet new -i CommunityToolkit.Datasync.Server.Template.CSharp
To create a project:
mkdir My.Datasync.Server
cd My.Datasync.Server
dotnet new datasync-server
📦 NuGet Packages
The following NuGet packages have been published:
Running Tests
The test projects use xUnit.net v3 on the Microsoft.Testing.Platform (MTP) runner. The root global.json opts in to the MTP experience for dotnet test (this requires the .NET 10 SDK or later).
# Run all tests
dotnet test
# Run a single test project, or filter by class / method
dotnet test --project tests/CommunityToolkit.Datasync.Client.Test
dotnet test --filter-class "*ConflictResolver_Tests"
# Collect code coverage (Cobertura XML is written to each project's TestResults folder)
dotnet test --coverage --coverage-output-format cobertura
# Write a TRX report as well
dotnet test --report-xunit-trx
Run dotnet test -? to list all available options.
Running Live Tests
The majority of tests in the test suite provide TestContainers so that the tests are run against real servers running inside containers. However, some test suites have not been set up yet or do not work as expected. For those services, you will need to provide a real service and configure environment variables before running dotnet test:
| Variable | Purpose |
|---|---|
ENABLE_SQL_LOGGING |
Set to true to log SQL statements during the tests. |
COSMOS_CONNECTION_STRING |
Connection string for the Cosmos DB live tests. |
DATASYNC_COSMOS_CONNECTIONSTRING |
Connection string for the Cosmos DB repository live tests. |
MONGO_CONNECTION_STRING |
Connection string for the Cosmos DB for MongoDB live tests. |
export COSMOS_CONNECTION_STRING="{insert your connection string here}"
dotnet test
NOTE: Connection strings are secrets. Do not check them in.
📖 Building the documentation site
The documentation site is built with MkDocs. To build and serve it locally:
python3 -m venv .venv-docs
source .venv-docs/bin/activate
pip install mkdocs mkdocs-mermaid2-plugin
mkdocs serve
Browse to http://localhost:7000 to view the site. mkdocs serve watches the docs folder and live-reloads whenever you make changes.
To produce a static build instead (the output is written to ./site, which is git-ignored):
mkdocs build
🌍 Roadmap
Read what we plan for next iterations, and feel free to ask questions.
🚀 Contribution
We welcome community contributions. Check out our contributing guide to get started.
📄 Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.
🏢 .NET Foundation
This project is supported by the .NET Foundation.
History
The Datasync Toolkit used to be known as Azure Mobile Apps. You can find the code for previous (unsupported) versions of the library at the old repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- CommunityToolkit.Datasync.Server.Abstractions (>= 10.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.14)
- Microsoft.Spatial (>= 8.4.4)
- MongoDB.Driver (>= 3.13.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.