Skip to main content
Expression trees · translators · analyzers

Vali-Flow

// one expression. many backends.

Build fluent rules once. Execute across 10 stores — EF Core, SQL, MongoDB, DynamoDB, Elasticsearch, Redis, Couchbase, Cosmos DB, Firestore or InMemory.

CoreEF CoreSQLInMemoryMongoDBDynamoDBElasticsearchRedisCouchbaseCosmosDbFirestoreCoreEF CoreSQLInMemoryMongoDBDynamoDBElasticsearchRedisCouchbaseCosmosDbFirestore
11packages
10stores
0 depscore deps
$dotnet add package Vali-Flow

Expressions that travel with your data

A single fluent expression becomes LINQ, SQL, NoSQL queries or in-memory checks.

01

Vali-Flow.Core

Dependency-free fluent builder for expression trees and in-memory validation.

02

Vali-Flow (EF Core)

Wrap an expression in a Specification and run it against DbSet<T> with async evaluators.

03

Vali-Flow.InMemory

Synchronous, zero-dependency evaluator for IEnumerable<T> — unit tests, caches, prototyping.

04

Vali-Flow.Sql

Translate an expression into a parameterized SQL WHERE clause for Dapper or raw ADO.NET.

05

Vali-Flow.NoSql.MongoDB

Translate an expression into a MongoDB BsonDocument filter.

06

Vali-Flow.NoSql.DynamoDB

Translate an expression into a DynamoDB FilterExpression for scans and queries.

07

Vali-Flow.NoSql.Elasticsearch

Translate an expression into an Elasticsearch Query object.

08

Vali-Flow.NoSql.Redis

Translate an expression into a RediSearch query string.

09

Vali-Flow.NoSql.Couchbase

Translate an expression into a Couchbase N1QL WHERE clause fragment.

10

Vali-Flow.NoSql.CosmosDb

Translate an expression into an Azure Cosmos DB SQL API WHERE clause fragment.

11

Vali-Flow.NoSql.Firestore

Translate an expression into a native Google.Cloud.Firestore Filter.

expression pipeline

Build → translate → execute

Core builds the expression tree. Evaluators translate it to the store you run.

ExpressionValiFlow<T>
CoreExpression Tree
TranslatorEF / SQL / NoSQL
EvaluatorEvaluateQueryAsync / Evaluate
StoreEF Core · SQL · Mongo
ResultRows / Matches
Vali-Flow.Core
new ValiFlow<Product>()
expression built
Vali-Flow (EF Core)
evaluator.EvaluateQueryAsync(spec)
IQueryable<Product>
Vali-Flow.Sql
expression.ToSql(dialect)
"WHERE price > @p0"
Vali-Flow.InMemory
evaluator.Evaluate(entity, expression)
true
Vali-Flow.NoSql.MongoDB
expression.ToMongo()
{ price: { $gt: 10 } }
Vali-Flow.NoSql.DynamoDB
expression.ToDynamoDB()
price > :v0
Vali-Flow.NoSql.Elasticsearch
expression.ToElasticsearch()
{ range: { price: { gt: 10 }}}
Vali-Flow.NoSql.Redis
expression.ToRedisSearch()
@price:[10 +inf]
Vali-Flow.NoSql.Couchbase
expression.ToCouchbase()
price > $p0
Vali-Flow.NoSql.CosmosDb
expression.ToCosmosDb()
c.price > @p0
Vali-Flow.NoSql.Firestore
expression.ToFirestore()
Filter.GreaterThan(...)
Program.cs
123456789
// Build the expression tree
var expression = new ValiFlow<Product>()
.EqualTo(p => p.IsActive, true)
.GreaterThan(p => p.Price, 10m);
// Apply it directly with EF Core
var result = await dbContext.Products
.Where(expression.Build())
.ToListAsync();

11 NuGet packages. Install only what you need.

Start with Core, add one evaluator, or mix multiple stores.

EF Core evaluator — wraps an expression in a Specification and reads/writes via DbSet<T>.

dotnet add package Vali-Flow

Core builder for expression trees and in-memory validation.

dotnet add package Vali-Flow.Core

Synchronous evaluator for IEnumerable<T> — tests, caches, prototyping.

dotnet add package Vali-Flow.InMemory

Translates an expression into a parameterized SQL WHERE clause for Dapper/ADO.NET.

dotnet add package Vali-Flow.Sql

Translates an expression into a MongoDB BsonDocument filter.

dotnet add package Vali-Flow.NoSql.MongoDB

Translates an expression into a DynamoDB FilterExpression.

dotnet add package Vali-Flow.NoSql.DynamoDB

Translates an expression into an Elasticsearch Query object.

dotnet add package Vali-Flow.NoSql.Elasticsearch

Translates an expression into a RediSearch query string.

dotnet add package Vali-Flow.NoSql.Redis

Translates an expression into a Couchbase N1QL WHERE fragment + params.

dotnet add package Vali-Flow.NoSql.Couchbase

Translates an expression into an Azure Cosmos DB SQL API WHERE fragment.

dotnet add package Vali-Flow.NoSql.CosmosDb

Translates an expression into a native Google.Cloud.Firestore Filter.

dotnet add package Vali-Flow.NoSql.Firestore

Where Vali-Flow fits best

Compose rules once, keep behavior consistent across services and storage layers.

REPOS

Repository Filters

Build expressions in the application layer and run them inside EF Core or raw SQL repos.

EvaluateQueryAsync(spec)
MULTI-STORE

Cross-Store Consistency

Use the same expression across all 7 NoSQL stores — MongoDB, DynamoDB, Elasticsearch, Redis, Couchbase, Cosmos DB, Firestore.

ToMongo / ToElasticsearch / ToSql
TESTS

Testing & Validation

Run expressions in memory to validate domain rules in fast unit tests.

Evaluate(entity, expression)