使用组合重叠实现

时间:2015-06-17 17:50:20

标签: c# asp.net-mvc entity-framework code-first

我想实现重叠。替代重叠是组成? enter image description here

enter image description here

我使用Entity Framwework(Code First)在asp.net mvc中执行此项目。任何想法怎么做?

Person.cs

 public abstract class Person
    {
        public int PersonId { get; set; }
        public string FirstName { get; set; }

        public string LastName { get; set; }

        public string Email { get; set; }

        public virtual ICollection<User> users { get; set; }

    }

User.cs

 public class User : Person
    {
        private Boolean Pelnoletni{get; set;}
        private string Adres{get; set;}
        private long Telefon_kontaktowy{get; set;}

        public virtual ICollection<Order> orders {get; set;}
        public virtual ICollection<Opinion> opinions { get; set; }

    }

Seller.cs

   public class User : Person
    {
        private Boolean Adult{get; set;}
        private string Adress{get; set;}
        private long Phone_number{get; set;}

        public virtual ICollection<Order> orders {get; set;}
        public virtual ICollection<Opinion> opinions { get; set; }

    }

0 个答案:

没有答案