Powerful, lightweight libraries built for the work we do.
Build expressive, structured CLI applications.
1var cmdDef = new CommandDefinition(name: "base64");
2cmdDef.Help = "Encodes or decodes string input as base 64.";
3cmdDef.AddOption<string>(
4 key: "value",
5 help: "The value to base 64 encode or decode",
6 (terse: "-v", verbose: "--value")
7);
8cmdDef.AddOption<bool>(
9 key: "encode",
10 defaultArg: true,
11 help: "True to encode...False to decode.",
12 (terse: "-e", verbose: "--encode")
13);
14cmdDef.Handler = (cmd) =>
15{
16 bool encode = cmd["encode"].GetValue<bool>();
17 string input = cmd["value"].GetValue<string>();
18 Console.WriteLine(encode ? Base64.Encode(input) : Base64.Decode(input));
19};
20DefinitionRegistry.GetInstance().Add(cmdDef);Option- and command-level constraints run before your handler.
Rendered directly from your command, option, and constraint definitions. No extra content to write.
Fast, lightweight in-memory database with file-backed durability.
1var db = MemDb.Open<Asset>("assets");
2var count = db.Count(a => a.Extension == ".jpg" && a.Tags.Contains("pets"));
3
4//get page 1 of (count / 100) total pages of pets pics in .jpg format
5Asset[] pets = db.Query()
6 .Where(a => a.Extension == ".jpg" && a.Tags.Contains("pets"))
7 .OrderBy((a, b) => a.CreatedAt.CompareTo(b.CreatedAt))
8 .Skip(0)
9 .Limit(100)
10 .ToArray();
11
12//update page, apply last access timestamp
13db.Update(
14 apply: (a) => a.LastAccessAt = DateTime.UtcNow,
15 where: (a) => Array.Exists(pets, (p) => p.Id == a.Id)
16);
17db.Dispose();Thread-safe in-process. Records deep-cloned at the cache boundary — no reference aliasing.
Fluent builder for filtering, sorting, and bulk writes. No SQL.
Flexible text templating engine with a small, fixed grammar.
<html>
<head>
<title>{Title}</title>
</head>
<body>
<h1>Hello {($)=>GetFullName},</h1>
<div>
Thank you for registering for the following {($) => GetSvcCount} services:
</div>
<ul>
{#each Services}
<li>{Name}</li>
{/each}
</ul>
{#if IsGoldMember}
<div>You will receive a 5% discount.</div>
{/if}
<div>Thank you,</div>
<div>{Supervisor}</div>
</body>
</html>Single-pass interpreter. No cold-start cost in serverless functions and other stateless workloads.
Host-registered functions invokable from any tag.
Typed JSON config and environment variables, explicit and validated at startup.
1var configMgr = JsonConfigManager.BuildInstance("default")
2 .Register<AppSettings>("app-settings.json")
3 .ApplyValidatorFor<AppSettings>(
4 c => c.TimeoutSeconds > 0,
5 "TimeoutSeconds must be positive"
6 )
7 .Build();
8
9AppSettings settings = configMgr.Get<AppSettings>();
10Console.WriteLine(settings.ApiBaseUrl);
11
12//adjust a runtime setting; rejected if the file changed since last read
13settings.TimeoutSeconds = 15;
14bool applied = configMgr.Put(settings);Optional AES-256-GCM encryption for JSON files and environment variable values.
One source per registration. No provider chain, no DI container required.