string类型无法转换guid

来源:3-7 【应用】添加初始化数据

zdasdf134

2020-12-06

添加初始化数据报错:The seed entity for entity type ‘TouristRoute’ cannot be added because the value provided for the property ‘Id’ is not of the type ‘System.Guid’. Consider using ‘DbContextOptionsBuilder.EnableSensitiveDataLogging’ to see the involved property values.

写回答

1回答

zdasdf134

提问者

2020-12-06

已解决。AppDbContext.cs文件中touristRoutePicturesMockData泛型TouristRoute,应该是TouristRoutePicture。

1
0

.Net 开发电商后端API 从0到精通RESTful

. Net 实战+RESTful思想纵深课程,开发优雅RESTful风格API。

977 学习 · 547 问题

查看课程