Osy#betaRun it on Osyrin: osyrin.com

Reference

Types

28 pages.

Every type, in one list

The complete vocabulary of built-in types — the scalars you can store, the collections, the two callable spellings (`Action` and `Func`), and the…

Types

The values your app computes with, and the declarations that name and scope them. Most scalar types are exactly C#'s — int, long, double, string…

Bitwise operators

`&`, `|`, `^`, `~`, `<<` and `>>` work on `int`, with C#'s meanings and C#'s precedence. Unlike `+`, `-`, `*` and `/`, they do not raise on overflow…

Comparing, casing and splitting text the C# way

The members of C#'s `string` that take a `StringComparison`, a `CultureInfo`, a `StringSplitOptions` or a `NormalizationForm` work as in C#, with…

Constant expressions

Some places take a value that must be known at compile time — an attribute argument, a config setting, a workflow message. Adjacent string literals…

DateOnly and TimeOnly

`DateOnly` is a calendar date (no time); `TimeOnly` is a time of day (no date) — the C# types. Build them with `new DateOnly(y, m, d)` / `new…

DateTime

A date and time. It is a wall-clock value, not an instant on a timeline, so it is never shifted by anybody's timezone. Reading its parts and doing…

DateTimeOffset

An instant *plus the offset it was recorded at*. Use it when the local time something happened is part of the fact — a warehouse `TIMESTAMP_TZ`, a…

Entity

`Entity` is a reference to a row of ANY type the app keeps — what a notification, a comment or a question "about some record" holds. It reads as its…

Geography

A place, a route or an area on the Earth, as a GeoJSON geometry — longitude/latitude, WGS84. It is exactly the shape a browser map library draws and…

IEnumerable<T>, IReadOnlyList<T>, IList<T> — the collection interfaces

C#'s collection interfaces are accepted wherever a type is written, each as the collection it names: IEnumerable<T>, IReadOnlyList<T> and…

Json

A member that holds a JSON document — an object, an array, or any value. It is stored as real jsonb, and written and read through JsonSerializer, so…

Markdown

A member that holds a markdown document. You read and write it as ordinary text, but it is stored as a list of sections split on its headings, so a…

Optional and required members

A member is required or optional by how you spell its type. A bare value type with a natural zero reads that zero; a bare value-shaped type with no…

TimeSpan (durations)

`TimeSpan` is the duration type — a length of time, as in C#. Build one with the `TimeSpan.FromX` factories or `new TimeSpan(…)`, read…

TimeSpan, DateOnly, TimeOnly

A duration, a bare date, and a bare time of day. Subtracting two DateTimes gives a TimeSpan; adding one back gives a DateTime. All three are exact…

When your name is already the platform's

The platform puts 70 ordinary English words in scope in every app with no `using` — `Group`, `Match`, `Point`, `Month`, `Now`, `Uri`, `Connection`…

bigdecimal

Exact base-10 arithmetic with 38 significant digits — for warehouse columns and anything else too wide for `decimal`. Every rule it follows is…

byte[]

Raw bytes — a file's contents, a digest, a key. Write one as C# does, `new byte[] { 0x89, 0x50 }`, or as a collection expression `[0x89, 0x50]`…

char

A single character, written in single quotes. It is what you get from `s[0]` and from iterating a string, and it is the argument the `char.*`…

decimal

Exact base-10 arithmetic, for money and anything else where a fraction of a cent matters. It behaves identically whether your code runs on the server…

long

A 64-bit whole number, exact to its full range — ids, sequence numbers, row versions, byte offsets. It holds the same value whether your code runs on…

namespace

Declares the namespace a file's types belong to, written once at the top of the file. It is optional — a file without one puts its types in the…

string literals — ordinary, verbatim and raw

Three ways to write a string, all of them C#'s. The ordinary form processes escapes. The verbatim form (`@"…"`) processes none and may span lines…

type visibility (public / internal)

A top-level declaration carries a public or internal visibility that decides whether code outside its package can name it. The default depends on…

typeof and GetType() — a Type is its name

typeof(X) and x.GetType() answer a Type, which is the type's name: Name ("Int32"), FullName ("System.Int32"), ToString() and ==. GetType() is the…

use

Declares a capability your app depends on, written inside the `app { }` manifest block. It provisions the capability (its tables and types become…

x! — the null-forgiving operator

A postfix `!` tells the compiler a value it types as possibly-null is present — C#'s null-forgiving operator. It is a compile-time promise only: it…