The expected type was 'System.Nullable`1[System.Guid]' but the actual value was of type 'System.Guid' 错误的解决

System.InvalidOperationException:“An exception occurred while reading a database value for property 'EL_DDT.DataId'. The expected type was 'System.Nullable`1[System.Guid]' but the actual value was of type 'System.Guid'.”

解决方法:

entity.Property(e => e.DataId).HasColumnType("char(36)");

原文地址:https://www.cnblogs.com/wjx-blog/p/11843558.html