mirror of
https://github.com/XFox111/MuiCharts.git
synced 2026-04-22 06:51:05 +03:00
Added ASP.NET backend with SQLite
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using MuiCharts.Domain.Models;
|
||||
|
||||
namespace MuiCharts.Infrastructure.Configurations;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the entity type configuration for the <see cref="Point"/> entity.
|
||||
/// </summary>
|
||||
public class PointEntityTypeConfiguration : IEntityTypeConfiguration<Point>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<Point> builder)
|
||||
{
|
||||
builder.HasKey(p => p.Id);
|
||||
builder.Property(p => p.Name).IsRequired();
|
||||
builder.Property(p => p.Height).IsRequired();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace MuiCharts.Domain.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the entity type configuration for the <see cref="Track"/> entity.
|
||||
/// </summary>
|
||||
public class TrackEntityTypeConfiguration : IEntityTypeConfiguration<Track>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<Track> builder)
|
||||
{
|
||||
builder.HasKey(t => new { t.FirstId, t.SecondId });
|
||||
builder.Property(t => t.Distance).IsRequired();
|
||||
builder.Property(t => t.Surface).IsRequired();
|
||||
builder.Property(t => t.MaxSpeed).IsRequired();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user