Smark.Data的实体描述能干什么
[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; }
}