Skip to content

Repository files navigation

Pure.Chart.RichRelationalModel.EFCore.Models

EF Core entity record implementations of the chart rich relational model for the Pure ecosystem.

.NET build & test Build and Deploy NuGet License: MIT

Overview

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.

Models

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.

Design Principles

  • 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.

Dependencies

Target Frameworks

  • .NET 7
  • .NET 8
  • .NET 9
  • .NET 10

Installation

dotnet add package Pure.Chart.RichRelationalModel.EFCore.Models

Usage

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
);

About

EF Core entity record implementations of the chart rich relational model for the Pure ecosystem.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from kudima03/Pure.Template