EntityFramework?????????
???????????? ???????[ 2015/4/3 14:21:19 ] ??????????????? EntityFramework ????
????EntityFramework???????????? ?????????????????2???????? ??????????????? ....
?????????????????
1 public static IM_CallRecord GetEFData()
2 {
3 using (ModelContainer mv = new ModelContainer())
4 {
5 return (from c in mv.IM_CallRecord where c.id == 12356 select c).SingleOrDefault<IM_CallRecord>();
6 }
7 }
8
9 static void Main(string[] args)
10 {
11 Console.WriteLine("??230????????????????");
12 //=================????SQL===================
13 var beginTime = DateTime.Now;
14 com.infusionmanage.model.impl.IM_CallRecordDAOImpl im = new com.infusionmanage.model.impl.IM_CallRecordDAOImpl();
15 im.findByPage(12356?? 1);
16 var endTime = DateTime.Now;
17 Console.WriteLine("---????SQL----???:" + (beginTime - endTime).ToString());
18
19 //=================EF???=====================
20 beginTime = DateTime.Now;
21 GetEFData();
22 endTime = DateTime.Now;
23 Console.WriteLine("??EF??????κ??:" + (beginTime - endTime).ToString());
24
25 beginTime = DateTime.Now;
26 GetEFData();
27 endTime = DateTime.Now;
28 Console.WriteLine("??EF??????κ??:" + (beginTime - endTime).ToString());
29
30 Console.ReadKey();
31 }
????????????
??????????????????EntityFramework??????????????????????????
????· All -in-1????????????????д?????? ???????????????
????· ??????????????????????貼????????????
????· ??LINQ???????????????????????????????SQL??
????· EF????????????????????OData Service??????????
????????????£??????????EF??:
????· ?????????????
????· ???????洢???????????? EF??????????????????Change???????????洢??????.?????EF????洢???????????????
????· ????????????Insert???? ????EF??????????Bulk ????
????· ??????2????????μ?????????????У???????????
???????磺UPDATE ???? SET ColumA = 10 Where ColumnB =??
??????????2????????????ExecuteNonQuery??????Context???????????Ado.Net????
????· ????????????????????? EF?????????????????????????????????????????????淶????
????· ??????з??????????? ??????????????м??.
??????
???·???
??????????????????
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