BLite.Client 0.1.3

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

BLite.Client

Official .NET SDK for BLite Server over gRPC.

What You Get

  • Typed collections (IDocumentCollection<TId, T>)
  • Dynamic BSON collections
  • LINQ query push-down
  • Transactions
  • Key-value API
  • Admin API (users and tenants)

Install

dotnet add package BLite.Client

1. Connect To BLite Server

using BLite.Client;

await using var client = new BLiteClient(new BLiteClientOptions
{
    Host = "localhost",
    Port = 2626,
    ApiKey = "your-api-key",
    UseTls = false
});

Port must point to the gRPC endpoint (2626 by default).

using BLite.Bson;

[DocumentMapper("users")]
public class User
{
    [BsonId]
    public ObjectId Id { get; set; }

    public string Name { get; set; } = string.Empty;
    public int Age { get; set; }
}

Use the generated mapper (for example UserMapper) to get a typed collection:

var users = client.GetDocumentCollection<ObjectId, User>(new UserMapper());

await users.InsertAsync(new User
{
    Id = ObjectId.NewObjectId(),
    Name = "Alice",
    Age = 30
});

var adults = await users.AsQueryable()
    .Where(x => x.Age >= 18)
    .OrderBy(x => x.Name)
    .ToListAsync();

3. Dynamic BSON Collections

using BLite.Bson;
using BLite.Proto;

var sensors = client.GetDynamicCollection("sensors");

var doc = await sensors.NewDocumentAsync(["name", "temp"], b => b
    .AddString("name", "room-1")
    .AddDouble("temp", 21.5));

_ = await sensors.InsertAsync(doc);

var q = new QueryDescriptor
{
    Collection = "sensors",
    Where = new BinaryFilter
    {
        Field = "temp",
        Op = FilterOp.Gt,
        Value = ScalarValue.From(20)
    }
};

await foreach (var item in sensors.QueryAsync(q))
{
    // process item
}

4. Transactions

await using var tx = await client.BeginTransactionAsync();

await users.InsertAsync(new User
{
    Id = ObjectId.NewObjectId(),
    Name = "Bob",
    Age = 41
}, tx);

await tx.CommitAsync();

5. Key-Value API

using System.Text;

await client.Kv.SetAsync("session:abc", Encoding.UTF8.GetBytes("payload"));
var value = await client.Kv.GetAsync("session:abc");

6. Admin API

using BLite.Core.Query;

var createdKey = await client.Admin.CreateUserAsync(
    username: "reporting",
    namespaceName: null,
    databaseId: null,
    permissions:
    [
        new UserPermission
        {
            Collection = "reports",
            Ops = BLiteOperation.Query
        }
    ]);

Notes

  • BLite Server must be reachable on gRPC endpoint.
  • In production prefer UseTls = true and secure secret handling for API keys.
  • Unsupported LINQ operators are applied client-side after streaming.
Product 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. 
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
0.2.0 0 3/16/2026
0.1.7 24 3/15/2026
0.1.6 27 3/15/2026
0.1.5 29 3/15/2026
0.1.4 32 3/14/2026
0.1.3 32 3/14/2026
0.1.2 32 3/13/2026