SharpConnector 3.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SharpConnector --version 3.1.0
                    
NuGet\Install-Package SharpConnector -Version 3.1.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="SharpConnector" Version="3.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpConnector" Version="3.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SharpConnector" />
                    
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 SharpConnector --version 3.1.0
                    
#r "nuget: SharpConnector, 3.1.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 SharpConnector@3.1.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=SharpConnector&version=3.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SharpConnector&version=3.1.0
                    
Install as a Cake Tool

SharpConnector

License: MIT Nuget NuGet Downloads issues - dotnet-design-patterns Build stars - dotnet-design-patterns

<img src="https://github.com/engineering87/SharpConnector/blob/main/sharpconnector_logo.jpg" width="300">

SharpConnector is a .NET library designed to streamline integration with NoSQL databases. It provides a unified interface that simplifies database operations, eliminating the need to develop custom logic for each specific database connector. Since each NoSQL database has its own unique characteristics—such as being document-oriented or key-value-based—SharpConnector abstracts these differences, providing a consistent and simplified access layer to accelerate development.

How it works

SharpConnector provides access to CRUD operations to NoSQL databases with <Key, Value>, abstracting the interface from the implementation. Insert, Get, Delete, Update operations are currently exposed to the following databases:

  • Redis
  • MongoDB
  • LiteDB
  • EnyimMemcached
  • RavenDB

How to use it

To get started with SharpConnector, configure your connectionString and specify the connector instance type. Then, add the ConnectorConfig node within your appsettings.json file. Here’s an example configuration for a Redis connector:

{
  "ConnectorConfig": {
    "Instance": "Redis",
    "DatabaseNumber": 0,
    "ConnectionString": "redisServer:6380,password=password,ssl=True,abortConnect=False"
  }
}

Once configured, create a new SharpConnector client, specifying the payload type (e.g., string):

SharpConnectorClient<string> client = new SharpConnectorClient<string>()

Alternatively, you can integrate SharpConnector client using dependency injection. Here’s how to register the SharpConnector service with a string payload type:

// Register the SharpConnector services with string payload type.
builder.Services.AddSharpConnectorServices<string>();

This setup provides flexibility in working with different payload types and makes SharpConnector easy to use within dependency injection configurations.

Contributing

Thank you for considering to help out with the source code! If you'd like to contribute, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you want to add new connectors, please follow these three rules:

  1. Each new connector must implement the IOperations interface.
  2. For each new connector the relevant UnitTest class must be present.
  3. Any third party libraries added in the code must be compatible with the MIT license, and the license must also be made explicit in the code.

Licensee

SharpConnector source code is available under MIT License, see license in the source.

External references

SharpConnector uses the following externals references:

  • StackExchange.Redis see license here
  • MongoDB.Driver see license here
  • LiteDB see license here
  • EnyimMemcached see license here
  • RavenDB see license here

Contact

Please contact at francesco.delre[at]protonmail.com for any details.

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
4.0.0 78 8/22/2025
3.3.0 167 3/19/2025
3.2.0 132 11/11/2024
3.1.0 117 10/29/2024
3.0.0 168 2/10/2024
2.0.0 362 1/22/2023
1.0.3 365 1/22/2023
1.0.2 479 8/1/2021
1.0.1 453 4/2/2021
1.0.0 511 11/25/2020