???????EF6.0???????Щ???????????
???????????? ???????[ 2016/1/26 14:00:31 ] ?????????????????? ???ù???
???????????
????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????????????????
???????
?????????????????????????????????????????????????????ɡ????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11