EntityFramework4.1和ADO.NET插入操作性能比较

插入实体的字段:

var data = new Comments();

data.ArticleId = 1;

data.AuditStatus = 2;

data.Company = 5;

data.Content = "测试";

data.CreateTime = DateTime.Now;

data.IP = "192.168.1.2";

data.NickName = "张三";

data.ReplyContent = string.Empty;

data.ReplyId = 0;

data.ReplyNickName = string.Empty;

data.ReplyTime = DateTime.Now;

data.Tel = "887964645";

data.UserId = 10;

 

插入1000条分别消耗的时间:

ADO.NET:

EF:

你可能感兴趣的:(framework)