0

Let's say I use a ValueObject for a ZipCode, and I have a Converter to save it as a string in the database.

// EntityTypeConfiguration
builder.Property(p => p.ZipCode)
    .HasConversion<ValueOfConverter<ZipCode, string>>()
    .HasMaxLength(PostalCodeMaxLength)
    .IsRequired();

When I'm doing a search, I have to cast like this or else I get and exception

// Query 
Query.Search(x => (string)(object)x.ZipCode, zipCode);
Noone
  • 395
  • 1
  • 4
  • 17

0 Answers0