现在的位置: 首页 > 综合 > 正文

Smark.Data的实体描述能干什么

2011年01月20日 ⁄ 综合 ⁄ 共 1074字 ⁄ 字号 评论关闭

    [Table("Customers")]

    interface ICustomer

    {

        [ID]

        string CustomerID { get; set; }

        [Column]

        [NotNull("公司名称不能为空!")]

        string CompanyName { get; set; }

        [Column]

        [NotNull("联系人不能为空!")]

        string ContactName { get; set; }

        [Column]

        string ContactTitle { get; set; }

        [Column]

        [NotNull("联系地址不能为空!")]

        string Address { get; set; }

        [Column]

        string City { get; set; }

        [Column]

        string Region { get; set; }

        [Column]

        string PostalCode { get; set; }

        [Column]

        string Country { get; set; }

        [Column]

        string Phone { get; set; }

        [Column]

        string Fax { get; set; }

    }

    [Table("Customers",DISTINCT=true)]

    interface ICountry

    {

        [Column("Country")]

        string Name { get; set; }

    }

    [Table("Customers")]

    interface ICountByCountry

    {

        [Column]

        string Country { get; set; }

        [Column("*")]

        [Count]

        int Count { get; set; }

    }

    [Table("Customers")]

    interface ICountByCity

    {

        [Column]

        string City { get; set; }

        [Column("*")]

        [Count]

        int Count { get; set; }

    }

抱歉!评论已关闭.