开发者

Entity Framework 4: Problem mapping column to complex type

I have a table with about 30+ columns, so i decided to group them using complex types. When trying to build the assembly, i get the following error:

Error 3023: Problem in mapping fragments starting at line 933:Colum开发者_如何学运维n TableName.ColumnName in table TableName must be mapped: It has no default value and is not nullable. One of my complex types includes a property with that exact name, and that exact data type. Any ideas on how i can approach this?


Ok i was too quick to blame it on Entity Framework, the problem was that i had the same table in the schema before, only mapped to a different table name (both tables have exactly the same structure and are in the same database). Now what i did was remove the reference to the old table and add the new one to the schema, and then i added the complex types that were already built for the old table. This of course was a problem because the complex types were mapped to columns in the old table. So what i did was delete the complex types and recreate new ones from the new table. Problem solved.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜