???????????
????1.???????????????
????2.???BaseContext:DbContext?????????????
????3.???????????????????
????4.????????????????????
????[Table("a_Emp")]
????public class Employee
?????????????????[table]С????????????????????????????????????dll
????using System.ComponentModel.DataAnnotations;
????using System.ComponentModel.DataAnnotations.Schema;
???????????μ???null? ef ???????????

???????????
??????????????????????????μ??ef ???丳????????????????磺ToList()??
????_db.Set<TEntity>().AddRange(entry);_db.SaveChanges();
????????????
????2????????
????1.?????????????ζ??????????????????? ???????????????????
????2.????????п??????????????????????
?????磺
????public DataTime? CreateTime{get;set;}
????public int? Num{get;set;}
????public decimal? Pirce{get;set;}
???????????????2?????ù?????
????EF?е????
??????????????????????????????????????????λ????????????????????????????
?????????2??????????????????????????????????? ???????????????? ????????????????????
??????????????????Employee?м????????????壬?????????Id??????????????????????ID ???????
????[Key]
????public int EmpId { get; set; }
????/// <summary>
????/// ????
????/// </summary>
????public string EmpName { get; set; }
????/// <summary>
????/// ???
????/// </summary>
????public string Sex { get; set; }
????/// <summary>
????/// ????
????/// </summary>
????public DateTime BirthDay { get; set; }
????/// <summary>
????/// ????
????/// </summary>
????public int DepId { get; set; }
????/// <summary>
????/// ????????
????/// </summary>
????[ForeignKey("EmpId")]
????public Dept Dept { get; set; } //???ForeignKey("EmpId")?е?EmpId ????????????
???????Dept??????б?????????
?????塢????????

????db.a_Emp.Include("Dept").Where(l => l.Dept.name.Contains(name)||string.IsNullOrEmpty(name)).ToList()
????????a_Emp????????????????baseContext????? public DbSet<Employee>a_Emp { get; set; }
????Dept.name????????????????
???????
?????????????????????????????????????????????????????ɡ????????????????????????????????