EF Core entity record implementations of the chart rich relational model for the Pure ecosystem.
Pure.Chart.RichRelationalModel.EFCore.Models provides four sealed record types that implement the interfaces from Pure.Chart.RichRelationalModel.Abstractions and are designed to be used as EF Core entity types.
Each model exposes both a strongly-typed navigation property (e.g. ChartTypeEFCoreModel TypeNavigation) that EF Core can bind to, and an abstract interface property (e.g. IChartType Type) that delegates to the navigation property — allowing callers to program against the abstraction while EF Core works with the concrete type.
| Class | Implements | Properties |
|---|---|---|
ChartEFCoreModel |
IChartRichRelationalModel |
Id, Title, Description, TypeId, TypeNavigation/Type, XAxisId, XAxisNavigation/XAxis, YAxisId, YAxisNavigation/YAxis, SeriesNavigation/Series |
ChartTypeEFCoreModel |
IChartTypeRichRelationalModel |
Id, Name |
ChartSeriesEFCoreModel |
IChartSeriesRichRelationalModel |
Id, ChartId, Legend, XAxisSource, YAxisSource |
AxisEFCoreModel |
IAxisRichRelationalModel |
Id, Legend |
All types live in the Pure.Chart.RichRelationalModel.EFCore.Models namespace.
- Immutable — all properties are get-only; values are set via constructor only.
- Dual surface — typed navigation properties satisfy EF Core; interface properties satisfy calling code.
- AOT-compatible —
IsAotCompatible = true; no reflection-based patterns.
Pure.Chart.RichRelationalModel.Abstractions— chart rich relational model interfaces (IChartRichRelationalModel,IAxisRichRelationalModel,IChartSeriesRichRelationalModel,IChartTypeRichRelationalModel)
- .NET 7
- .NET 8
- .NET 9
- .NET 10
dotnet add package Pure.Chart.RichRelationalModel.EFCore.Models
using Pure.Chart.RichRelationalModel.Abstractions;
using Pure.Chart.RichRelationalModel.EFCore.Models;
// Construct with navigation objects for in-memory use or testing
IChartRichRelationalModel chart = new ChartEFCoreModel(
id: guid,
title: title,
description: description,
typeId: typeId,
typeNavigation: new ChartTypeEFCoreModel(typeId, typeName),
xAxisId: xAxisId,
xAxisNavigation: new AxisEFCoreModel(xAxisId, xAxisLegend),
yAxisId: yAxisId,
yAxisNavigation: new AxisEFCoreModel(yAxisId, yAxisLegend),
seriesNavigation: []
);
// Or use the FK-only constructor when EF Core will populate navigations
ChartEFCoreModel chartFk = new ChartEFCoreModel(
id, title, description, typeId, xAxisId, yAxisId
);