labdb/Models/TestOffer.cs

31 lines
978 B
C#
Raw Normal View History

2022-11-10 19:59:35 +01:00
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace labdb.Models;
2022-11-15 18:07:10 +01:00
public record TestOfferId : EntityIdBase<TestOfferId>;
2022-11-10 19:59:35 +01:00
2022-11-15 18:07:10 +01:00
public class TestOffer : EntityBase<TestOfferId>
2022-11-10 19:59:35 +01:00
{
public LabId LabId { get; init; } = null!;
public Lab Lab { get; init; } = null!;
public TestId TestId { get; init; } = null!;
public Test Test { get; init; } = null!;
public decimal Price { get; set; }
public string? ServiceDirectoryLink { get; set; }
public decimal BloodVolume { get; set; }
public string? TestMethod { get; set; }
public string? Notes { get; set; }
}
2022-11-15 18:07:10 +01:00
public class LabTestConfiguration : EntityBaseConfiguration<TestOffer, TestOfferId>
2022-11-10 19:59:35 +01:00
{
2022-11-15 18:07:10 +01:00
public override void Configure(EntityTypeBuilder<TestOffer> builder)
2022-11-10 19:59:35 +01:00
{
base.Configure(builder);
builder.HasIndex(x => x.Price);
builder.HasIndex(x => x.TestMethod);
builder.HasIndex(x => x.BloodVolume);
}
}