0
通知クラスのGigプロパティの[必須]属性を次の流暢なapi式で置き換えます。C#、EF6 - 流暢なAPIで必要な属性を置き換えます
public class NotificationConfiguration : EntityTypeConfiguration<Notification>
{
public NotificationConfiguration()
{
Property(n => n.Gig).IsRequired();
}
}
私はそうした場合、コンパイラはエラーCS0453をスロー:
The type 'Gig' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'StructuralTypeConfiguration'<Notification>.Property<T>(Expression<Func<Notification, T>>)'
私はこれが動作しない理由を、見ることができません。
ありがとうございます!