DbTableMaps a type to a table and, when needed, its schema.
Fusion adapts to an existing schema. Mapping remains explicit, and materialization accepts either one complete public constructor or a public parameterless constructor followed by public setters.
DbKey identifies the key used to deduplicate joined rows and track changes.
C# records are materialized through their complete constructor.
public sealed record Person(
[property: DbKey]
long ID,
string LastName,
string FirstMidName,
DateTime EnrollmentDate,
string Discriminator);
public sealed record Course(
[property: DbKey]
long CourseID,
string Title,
int Credits,
long DepartmentID);
public sealed record Department(
[property: DbKey]
long DepartmentID,
string Name,
decimal Budget,
long InstructorID);
public sealed record OfficeAssignment(
[property: DbKey]
long InstructorID,
string Location);
public sealed record CourseAssignment(
[property: DbKey]
long InstructorID,
[property: DbKey]
long CourseID);
public sealed record DepartmentDto(
long Id,
string Name,
decimal Budget,
long InstructorId,
List<CourseDto> Courses);
public sealed record CourseDto(
long Id,
string Title,
int Credits);DbTableMaps a type to a table and, when needed, its schema.
DbColumnMaps a property to a column with a different name.
DbKeyDeclares one or more key properties.
DbIgnoreExcludes a property from mapping.
DbReadOnlyReads a property without including it in generated writes.