Getting Started
Introduction
A unified, metadata-driven approach to working with different data providers.
ARX.SDK is a data access SDK designed to provide developers with a consistent and structured way of interacting with different database providers through a unified programming model.
Instead of learning and maintaining entirely different approaches for every database technology, ARX.SDK introduces a common set of abstractions for working with entities, attributes, conditions, and data operations.
Its design is inspired by the Entity and Service patterns of Microsoft's Dynamics XRM framework, particularly its metadata-driven approach to representing and manipulating data. ARX.SDK is an independent project: it is not built on Microsoft's implementation or associated with Microsoft.
However, ARX.SDK is built with a different philosophy: developers should retain control over their applications, data structures, and database interactions. The SDK aims to bring the convenience of a unified data access model without imposing a rigid application framework or tying developers to a particular ecosystem.
Whether working with relational databases or NoSQL providers, ARX.SDK aims to make the development experience more consistent while respecting the capabilities and characteristics of each underlying technology.
Core concepts
- Entity
- A unified representation of a data record and its attributes.
- In code
new ArxEntity("account") - Attributes
- A dictionary-driven way of defining and accessing entity data.
- In code
account["name"] = "Northwind Traders" - Conditions
- A structured approach to defining data filters and query criteria.
- In code
query.Criteria.AddCondition("employee_count", ArxConditionOperator.GreaterEqual, 40) - Service
- A consistent interface for performing data operations.
- In code
CreateAsync, RetrieveAsync, RetrieveMultipleAsync, UpdateAsync, DeleteAsync, ExecuteAsync - Provider Abstraction
- Provider-specific implementations that translate the common programming model into operations supported by each database.
- In code
ARX.SDK.PostgreSql → ArxPgDbService
What it looks like
An entity, its attributes, a condition and the service, using the PostgreSQL provider.
using ARX.SDK.PostgreSql.Services;
using ARX.SDK.Query;
using ARX.SDK.Services;
// Declare each table's id column once, at startup.
var schema = ArxSchemaCatalog.Create()
.Table("account", ArxIdColumn.Generated<long>("id"))
.Build();
// The service: here, the PostgreSQL provider's.
var service = new ArxPgDbService(connectionString, schema);
// An entity and its attributes.
var account = new ArxEntity("account");
account["name"] = "Northwind Traders";
account["account_number"] = "HOME-0001";
account["employee_count"] = 240;
ArxRecordId id = await service.CreateAsync(account);
// A query with conditions.
var query = new ArxQueryExpression("account");
query.ColumnSet.AddColumns("name", "employee_count");
query.Criteria.AddCondition("employee_count", ArxConditionOperator.GreaterEqual, 40);
query.AddOrder("name", ArxOrderType.Ascending);
ArxEntityCollection result = await service.RetrieveMultipleAsync(query);Taken from two samples that were built and run against PostgreSQL: Create one record and Retrieve many records with a query. PostgreSQL is the most complete provider today; see Supported Providers for the others.
Who it is for
ARX.SDK fits code that works with records whose tables are known by name at run time, or that must run on more than one database:
- a product sold to customers who each bring their own database (PostgreSQL, SQL Server, MySQL, MongoDB or DynamoDB);
- metadata-driven applications: configurable forms, import tools, admin screens, where tables and columns are data;
- teams coming from the Dynamics 365 / XRM SDK who want the same entity and query model on their own databases.
For an application on one database with a fixed schema, EF Core (typed models, LINQ, migrations) or Dapper (your own SQL) are usually the better tools: the EF Core and Dapper guide compares them honestly.
The goal is simple: write application code using a familiar, consistent approach while retaining the flexibility to work with different database technologies.
Where to go next
Working with an AI coding assistant? Give it llms.txt: a knowledge base per provider, generated from verified samples, and the arx-sdk skill for coding agents.