Regira Engineering Blog

Notes on .NET, TypeScript & Vue

Patterns, gotchas and small wins from fifteen-odd years of .NET and web work — the Regira packages and modules, entity pipelines, editorial front-ends and everything between.

13 articles
Data & EF Core / Architecture

When Two People Edit the Same Record

Series · Writing in Regira Entities

When two people save the same record, the second save is refused instead of quietly erasing the first, whichever database the application runs on. The second user reloads and re-applies their change.

9 min read
Data & EF Core / Architecture

Omitted Is Not Empty

Series · Writing in Regira Entities

Saving a record from a small form should never wipe the items attached to it, while the full edit screen can still remove them all. How an API tells an omitted list from an empty one, and what a form sends for a row the user removed.

7 min read
Data & EF Core / Architecture

An Update That Blanks a Field the Form Never Showed

Series · Writing in Regira Entities

Keep an update from blanking a field the form never showed, such as a reference code, a close date or a total. What causes it, why every line involved passes review, and the one-line declaration that prevents it.

5 min read
Data & EF Core / Architecture

Rules That Hold on Every Save

Series · Writing in Regira Entities

One place for each rule a save must obey, so it holds whether a user, an import or a nightly job did the saving. Required fields, timestamps and a code that never changes stop being scattered across controllers.

9 min read
Data & EF Core / Architecture

How to Query Hierarchies at Any Depth with EF Core

Series · Hierarchical data

Answer 'everything under X' for category trees, org charts and folders, at any depth. Three approaches, from one that works on any database to one that scales to millions of rows, and how to pick.

Pinned 17 min read
Data & EF Core / Architecture

One Database, Many Customers, No Leaks

One customer must never see another's rows, in any list, count or endpoint, including the one added next year. Seven requirements that make that a property of the system, and which of them no library can meet for you.

12 min read
.NET / Data & EF Core / Architecture

Westeros, the Iron Throne, and a Model for Complex Relationships

Series · People, organisations and alliances

One table for every customer, supplier and employee, with roles and alliances as dated relationships instead of extra tables. Tested on Westeros, where everyone knows who betrayed whom and when.

Pinned 14 min read
Data & EF Core / Architecture

Let Users Search for This or That

Series · Filtering in Regira Entities

Let users ask for this or that, one brand or anything overdue, in a list that still pages and sorts like every other. How to offer 'or' without a flag nobody trusts.

3 min read
Data & EF Core / Architecture

Filters You Register Once and Cannot Forget

Series · Filtering in Regira Entities

Rules that must hold for every record, such as hiding deleted data or showing each customer only their own, set up once and applied everywhere. They also cover the endpoint added next year, and nobody skips them by accident.

3 min read
Data & EF Core / Architecture

A Search Box That Finds Café When You Type Cafe

Series · Filtering in Regira Entities

A search box that finds 'Café' when someone types 'Cafe', and 'Mercedes-Benz' for 'mercedes', without extra work on every search. The trick: tidy the text once when it is saved, not each time someone searches.

4 min read
Data & EF Core / Architecture

Delete Without Losing Anything

Series · Filtering in Regira Entities

Let users delete a record and still get it back: it disappears from every screen, stays in the database, and restores in one click. A recycle bin and an audit view come with it, no extra code.

5 min read
Data & EF Core / Architecture

Sorting and Paging Without Surprises

Series · Filtering in Regira Entities

Lists that users sort by several columns, that load related data only when a screen asks, and that never hand a client a million rows. Declared once, applied to every list.

5 min read