using Microsoft.EntityFrameworkCore; namespace RhSolutions.Models; public class RhSolutionsContext : DbContext { public RhSolutionsContext(DbContextOptions options) : base(options) { } public DbSet Products => Set(); protected override void OnModelCreating(ModelBuilder builder) { builder.Entity() .Property(e => e.ProductSku) .HasConversion(v => v.ToString(), v => new ProductSku(v)); builder.Entity() .PrimitiveCollection(e => e.DeprecatedSkus) .ElementType() .HasConversion(typeof(SkuConverter)); } }