Foundgine

AOT metadata and connections

Foundgine’s AOT path moves stable domain knowledge out of the request path.

PlantUML diagram: AOT, diagram 1

Important boundary

Foundgine does not generate or populate entity/model objects.

This deliberately avoids becoming an object mapper or a second ORM.

Connections

A model can declare a semantic connection:

[FoundgineModel]
public sealed class Product
{
    [FoundgineConnection(typeof(Contract))]
    public Contract Contract => throw new NotSupportedException();
}

The property is a declaration of topology. Foundgine never evaluates it and never constructs a Contract.

The generator emits:

PlantUML diagram: AOT, diagram 2

Relational key details remain on the storage side. This is intentional: a connection says what may be visited, while EF/entity metadata says how the storage relationship exists.

Mapping direction

Field correspondence should remain convention-first. When a model and entity need explicit semantic correspondence, the intended next layer is ordinary C#/LINQ expression analysis at build time. Those expressions describe a plan; they are not runtime mappers.

Special conversions such as ProductType → ContractType should therefore be represented as compile-time transformations in the mapping IR, rather than requiring generated entity/model population.

Runtime goal

PlantUML diagram: AOT, diagram 3

The expensive discovery work belongs in AOT. Runtime should bind request-specific values and execute the already-known topology.


Next: Public API