zoukankan      html  css  js  c++  java
  • 面向对象的实体设计

    public class Customer
        {
            public virtual int CustomerId { get; set; }
            public virtual string Firstname { get; set; }
            public virtual string Lastname { get; set; }
            //一对多关系:Customer有一个或多个Orders
            public virtual IList<Order> Orders { get; set; }
        }


    public class Order
        {
            public virtual int OrderId { get; set; }
            public virtual DateTime OrderDate { get; set; }
            //多对一关系:Orders属于一个Customer
             public virtual Customer Customer { get; set; }
            //多对多关系:Order有多个Products
             public virtual IList<Product> Products { get; set; }
        }

     public class Product
        {
            public virtual int ProductId { get; set; }
            public virtual string Name { get; set; }
            public virtual float Cost { get; set; }
            //多对多关系:Product属于多个Orders
            public virtual IList<Order> Orders { get; set; }
        }

  • 相关阅读:
    C
    A
    G
    B
    一些新玩意:
    Angular常用功能
    node学习笔记(四)
    node学习笔记(三)
    node学习笔记(二)
    node学习笔记
  • 原文地址:https://www.cnblogs.com/zhuawang/p/2108963.html
Copyright © 2011-2022 走看看