English 中文(简体)
• 如何迫使欧洲预防犯罪中心在没有执行的情况下生产
原标题:How to force EF LINQ query generation without execution

我用实体框架4.1 首先,通过存放方式揭露可资利用的教益。 在对储存库客户进行测试时,很容易对基本数据库进行 mo弄,不过,没有发现某类ug子:

存放处的客户可自由将自己的准则定位,加入,等等放在存放处的回报之上:

{
     _myRepository.FindAll().Where( x => x.Id == 3 && SomeMethod(x.Name) == "Hello" );
}

这种质询将成功进行一项单元测试,测试 mo-米贮存,因为模拟回收实体的内层集,而LINQ-to-标的分子则乐意称之为“SomeMethod”。 由于“SomeMethod”没有翻译到LINQ-to-Entities中,它不会对真正的数据储存提出异议。

我试图指出,我既能够篡改数据集,又能够使真正的欧洲质询提供者产生(但不会执行)KQ。 为什么? 由于这些测试本应很快,我不希望它们尽可能打上真正的数据库。 制作这套文件将回避翻译问题。

迄今为止,我未能说明如何做到这一点,因为在我的单位测试中,我最终无法控制问询何时完成。 我认为,我要么需要提供我自己的版本的“可资利用”和各种可资借鉴的推广方法,要么通过提供机制尝试和 h(使用几年前的样本,这种样本确实是打猎/拖拉供应商)。 两者似乎都有许多工作。 任何关于如何实现这一目标的想法?

最佳回答
问题回答

暂无回答




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签