using System;using System.Collections.Generic;using System.ComponentModel.DataAnnotations;using System.ComponentModel.DataAnnotations.Schema;using System.Linq;using System.Text;using System.Threading.Tasks;namespace firstCodeFirstApp{public class Donator{public int DonatorId { get; set; }public string Name { get; set; }public decimal Amount { get; set; }public DateTime DonateDate { get; set; }public virtual ICollection<PayWay> PayWays { get; set; }public int? DonatorTypeId { get; set; }public virtual DonatorType DonatorType { get; set; }public Donator(){PayWays = new HashSet<PayWay>();}}public class DonatorType{public int Id { get; set; }public string Name { get; set; }public virtual ICollection<Donator> Donators { get; set; }}[Table("PayWay")]public class PayWay{public int Id { get; set; }[MaxLength(8, ErrorMessage = "支付方式的名称长度不能大于8")]public string Name { get; set; }[Column("DonatorId")]public int DonatorId { get; set; }}public class Person{public Person(){Companies = new HashSet<Company>();}public int PersonId { get; set; }public string Name { get; set; }public bool IsActive { get; set; }public virtual Student Student { get; set; }public virtual ICollection<Company> Companies { get; set; }}public class Student{public int PersonId { get; set; }public virtual Person Person { get; set; }public string CollegeName { get; set; }public DateTime EnrollmentDate { get; set; }}public class Company{public Company(){Persons = new HashSet<Person>();}public int CompanyId { get; set; }public string CompanyName { get; set; }public virtual ICollection<Person> Persons { get; set; }}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。