我正在尝试基于旧版sql Server 2008数据库创建Entity Framework 4模型.由于该模型将在Web服务中发布,因此我需要省略一个名为NewsletterSubscribed的整数列,该列来自模型的一个实体.
Error 59 Error 3023: Problem in mapping fragments starting at line 356:Column Users.NewsletterSubscribed in table Users must be mapped: It has no default value and is not nullable. C:\Users\Adrian\Documents\Sites\Zeiterfassung\Zeiterfassung\API\V1\EFModel.edmx 357 15 Zeiterfassung
ALTER TABLE [dbo].[Users] ADD DEFAULT ((0)) FOR [NewsletterSubscribed]
但那也失败了:
Msg 1781,Level 16,State 1,Line 3
Column already has a DEFAULT bound to
it. Msg 1750,State 0,Line
3 Could not create constraint. See
prevIoUs errors.
因此,该列没有默认值(在这种情况下,我不确定为什么我不能创建一个),或者实体框架没有看到它.到底是怎么回事?
谢谢,
阿德里安