labdb/Models/TestOffer.cs
2022-11-15 18:07:10 +01:00

31 lines
978 B
C#

using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace labdb.Models;
public record TestOfferId : EntityIdBase<TestOfferId>;
public class TestOffer : EntityBase<TestOfferId>
{
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; }
}
public class LabTestConfiguration : EntityBaseConfiguration<TestOffer, TestOfferId>
{
public override void Configure(EntityTypeBuilder<TestOffer> builder)
{
base.Configure(builder);
builder.HasIndex(x => x.Price);
builder.HasIndex(x => x.TestMethod);
builder.HasIndex(x => x.BloodVolume);
}
}