zoukankan      html  css  js  c++  java
  • castle ActiveRecord入门实例(2)映射管理

    1.类别映射

    [ActiveRecord("Catalog")]
    public class Catalog: ActiveRecordBase<Catalog>

    {
      [PrimaryKey]
      public int CatalogId { get; set; }
      [Property]
      public string Name { get; set; }

      [HasMany]
      public IList<Movies> MovieList{ get; set; }
    }

    [ActiveRecord("Movies")]
    public class Movies : ActiveRecordBase<Movies>
    {
      [PrimaryKey]
      public int ID{get;set;}
      [Property]
      public string Title{get;set;}
      [Property]
      public DateTime ReleaseDate{get;set;}
      [Property]
      public string Genre{get;set;}
      [Property]
      public double Price{get;set;}
      [Property]
      public string Rating{get;set;}

      [BelongsTo("CatalogId")]
      public Catalog catalog { get; set; }


          public Movies()
          {
          }

  • 相关阅读:
    Safari-IoS调试
    前端加密技术
    gulp入门
    xss攻击
    xml 解析
    python 基本语法
    python初识
    字节
    神奇的算式
    linux-虚拟机安装
  • 原文地址:https://www.cnblogs.com/kenny999/p/2327751.html
Copyright © 2011-2022 走看看