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)");

posted @ 2019-11-12 17:29  星星c#  阅读(684)  评论(0编辑  收藏  举报