简体   繁体   中英

The property 'xxx' on entity type 'xxx' cannot be marked as nullable/optional because the type of the property is 'short' which is not a nullable type

I have an entity with short data type and I want another entity to have a null-able relationship with this table. After executing Add-Migration I get the error in mentioned in Title of this question. Isn't it possible to have short as null-able property?

By changing short to short? the error is gone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM