How to make a nullable property in EF Codefirst?

前端 未结 3 1629
感动是毒
感动是毒 2021-01-27 02:43

I have two POCOs in my \"Bookshelf\" test application:

/// 
/// Represents a book
/// 
public class Book
{
    public int ID { get         


        
3条回答
  •  一个人的身影
    2021-01-27 03:12

    Couldn't you just use something like this

    public virtual Nullable LoanedTo { get; set; }
    

    That then should make LoanedTo a nullable property

提交回复
热议问题