1、主键
  [PrimaryKey]
  public int Id
  {
   get { return id; }
   set { id = value; }
  }

2、ColumnType  
//如果内容很多(数据库类型为text)必须指定ColumnType为StringClob,.net类型为string;如果数据库类型为binary,必须指定ColumnType为BinaryBlob,.net类型为byte[]
  [Property(ColumnType="StringClob")]
  public String Contents
  {
   get { return contents; }
   set { contents = value; }
  }  
3、BelongsTo
//Post的blogid是Blog表的外键
  [BelongsTo("blogid")]
 public Blog OwnerBlog

    {

        get { return blog; }

        set { blog = value; }

    }

相关文章:

  • 2022-12-23
  • 2022-02-05
  • 2022-02-24
  • 2022-01-21
  • 2021-04-25
  • 2021-12-30
  • 2021-12-20
猜你喜欢
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2021-10-24
  • 2022-12-23
相关资源
相似解决方案