Skip to content

Instantly share code, notes, and snippets.

@DannyRusnok
Created January 7, 2022 16:11
Show Gist options
  • Save DannyRusnok/35cc4820c2c23843068f299f2df53476 to your computer and use it in GitHub Desktop.
Save DannyRusnok/35cc4820c2c23843068f299f2df53476 to your computer and use it in GitHub Desktop.
Value Objects Article
modelBuilder.Entity<Person>()
.Property(e => e.Address)
.HasConversion(
v => JsonSerializer.Serialize(v, (JsonSerializerOptions)null),
v => JsonSerializer.Deserialize<Address>(v, (JsonSerializerOptions)null));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment