1 Star 0 Fork 0

debuglife/CodeFirstApp

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Models.cs 2.07 KB
一键复制 编辑 原始数据 按行查看 历史
debuglife 提交于 2016-07-10 12:59 +08:00 . first codefirstapp
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; }
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zanpen2000/CodeFirstApp.git
git@gitee.com:zanpen2000/CodeFirstApp.git
zanpen2000
CodeFirstApp
CodeFirstApp
master

搜索帮助