I have a domain model that makes use of Guids for primary/foreign keys. Is there a way to instruct the ModelBuilder to explicitly create database tables with nvarchar storage for these properties without applying annotations on every existing primary and foreign key in my entity classes?
Use the Microsoft.EntityFrameworkCore.Storage.ValueConversion.GuidToStringConverter
value converter.
var guidToStringConverter = new GuidToStringConverter();
modelBuilder.Entity<YourEntity>()
.Property(ye => ye.PropertyThatIsAGuid)
.HasConversion(guidToStringConverter);