Skip to content

couchand/oracular-dot-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oracular-dot-net

a query builder

  • intro
  • getting started
  • more information

Build Status

intro

oracular is a little query builder based on the specification pattern and oriented towards business users. The goal is to refactor business logic in such a way that it can be easily stored and used to drive the execution of business applications.

getting started

Install the package with NuGet.

NuGet Install-Package Oracular

Load and check your config file.

var path = HostingEnvironment.MapPath(@"~/App_Data/oracular.json");
var config = OracularConfig.LoadFromFile(path);

config.Check();

Serialize some spec queries.

var customers = config.GetSpec("isCustomerAccount");
var customersSql = spec.ToSql();

var managers = config.GetSpec("isManagerUser");
var managersSql = spec.ToSql();

Check a new spec against the config file.

var specSource = "isCustomerAccount(Account) AND isManagerUser(Account.Owner)";
config.CheckSpec("Account", specSource);

Add the new spec to the live configuration.

config.AddSpec("isCustomerOwnedByManager", "Account", specSource);

Export the updated configuration file.

var updatedJson = config.Export();

more information

See the oracular project repository for documentation.

╭╮☲☲☲╭╮

About

a query builder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages