-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
Tom Laird-McConnell edited this page May 24, 2026
·
1 revision
Get from zero to search in under two minutes.
dotnet add package LottaDB
No attributes needed. Any plain C# class works:
public class Actor
{
public string Username { get; set; } = "";
public string DisplayName { get; set; } = "";
public int FollowerCount { get; set; }
}All simple-type properties (string, int, bool, DateTime, etc.) are automatically indexed and queryable.
For production with Azure:
// Connection string constructor -- sets up Azure Table + Blob Storage automatically
var catalog = new LottaCatalog("myapp", connectionString);
// Get a database within the catalog
var db = await catalog.GetDatabaseAsync("social");To get started quickly without Azure, install LottaDB.Memory and use the in-memory provider:
dotnet add package LottaDB.Memory
// In-memory provider -- no Azure account needed, great for trying things out
var catalog = new LottaCatalog("myapp", catalog => catalog.UseMemory());
var db = await catalog.GetDatabaseAsync("social");See Configuration for all available storage providers (UseAzure, UseFileSystem, UseSQLite).
await db.SaveAsync(new Actor
{
Username = "alice",
DisplayName = "Alice",
FollowerCount = 42
});No [Key] attribute? LottaDB auto-generates a ULID key. To retrieve the generated key:
var actor = new Actor { Username = "alice", DisplayName = "Alice" };
await db.SaveAsync(actor);
var key = actor.GetKey(); // auto-generated ULID like "01HX..."var actor = await db.GetAsync<Actor>(key);// LINQ on indexed properties
var results = db.Search<Actor>()
.Where(a => a.DisplayName == "Alice")
.ToList();
// Full-text search
var found = db.Search<Actor>("alice").ToList();await db.DeleteAsync<Actor>(key);Want to control which properties are indexed, set custom keys, or configure exact-match vs. full-text search? See Storing POCOs.