Skip to main content
EasyAF is a set of libraries you can drop into any .NET project, and a CLI that scaffolds a full application. Start with Core. Reach for the CLI when you want the whole stack.

Use EasyAF.Core

EasyAF.Core is the shared primitives: observable objects, intervals, identity, and audit interfaces. Add it to a class library, console app, Blazor project, or WPF app. Nothing else in EasyAF is required.

Step 1: Install the package

Step 2: Observable objects

EasyObservableObject implements INotifyPropertyChanged with strongly typed Set helpers. Use it anywhere you need change notification — XAML binding, Blazor, or a view-model that should raise events only when the value actually changes.
DbObservableObject adds change tracking for entities you round-trip to an API. Call TrackChanges, edit properties through Set, then send a delta of only what changed:
See the Observable Objects guide for cloning, rejecting changes, and graph traversal.

Step 3: Intervals

Interval<T> is time per occurrence — how long between events — with PerHour / PerDay / PerYear converting that into a frequency.
MoneyInterval<T> is the same math for money: an amount that occurs on an interval, converted to any other period.
RatioInterval<T> and PercentageInterval<T> do the same for conversion rates and percents. The Interval Calculations guide covers those. Core also ships IIdentifiable<T>, audit interfaces (ICreatedAuditable, ICreatorTrackable<T>, …), and Ensure argument guards. You can stop here and use those types in any project.

Scaffold an EasyAF application

When you want entities, managers, and a Restier API generated from a database, the CLI builds the solution EasyAF expects.

Step 1: Install the CLI

The tool command is dotnet easyaf.

Step 2: Create a solution

From an empty folder:
That creates a .slnx with the projects EasyAF expects, already referenced and packaged: Useful flags:
new only creates and links projects. It does not restore, build, or connect a database.

Step 3: Connect a database

Point EasyAF at SQL Server or PostgreSQL. The connection string can be a real string (stored in user secrets) or a pointer into appsettings.json:
init writes {ContextName}.edmx.config in the .Data project and sets EasyAF project types on the solution. When you are joining an existing EasyAF repo, use dotnet easyaf setup to store a local connection string instead.

Step 4: Generate from your schema

Scaffold the EDMX from the database, then generate C# for every layer:
Code generation produces:
  • Core entities that implement EasyAF interfaces (IIdentifiable<T>, ICreatedAuditable, IHumanReadable, …)
  • A DbContext in .Data
  • A manager per entity in .Business
  • Restier API surface in .Api
Generate a single layer when you need to:

Step 5: Work with a manager

Generated entities compose EasyAF interfaces. A typical product looks like this:
Managers wrap CRUD, fill audit fields, and give you lifecycle hooks. Customize a generated manager (or write one) like this:
Call it from your API or another manager:
InsertAsync sets Id, DateCreated, and any creator/updater fields the entity implements. You do not write that boilerplate yourself.

Step 6: Run the API

The Restier host exposes your entities over OData. Browse $metadata and query collections the same way you would any Restier API.

Next Steps

Observable Objects

Property change notification and delta payloads

Interval Calculations

Frequency, money, ratios, and percentages over time

Table Design

Composable interfaces for keys, audit fields, and naming

Business Layer

Manager hierarchy, lifecycle hooks, and CRUD