关键对象AttributeMappingSource

 

        [TestMethod]
        public void TestMethod1()
        {
            AttributeMappingSource source = new AttributeMappingSource();
            for (int i = 0; i < 10000; i++)
            {

                //AttributeMappingSource source = new AttributeMappingSource();--》去掉注释试试性能

                HRDataContext context = new HRDataContext(connString, source);
                var emp = context.GetTable<HR_Employee>().Where(p => p.EmployeeId == 10);

            }
        }

  

只要static一下AttributeMappingSource,每次使用就可以了

相关文章:

  • 2021-06-04
  • 2021-06-24
  • 2022-02-06
  • 2021-12-24
  • 2021-06-03
  • 2021-06-03
猜你喜欢
  • 2021-11-30
  • 2021-10-25
  • 2022-01-04
  • 2022-12-23
  • 2021-10-30
  • 2021-06-12
相关资源
相似解决方案