3 ms·
I don't do inline Sql. I use Linq and Moq out the EFContext with List<T> https://msdn.microsoft.com/en-us/library/dn314429(v=vs.113).aspx https://msdn.microso
by scarface74 9y ago
I don't do inline Sql. I use Linq and Moq out the EFContext with List<T>
https://msdn.microsoft.com/en-us/library/dn314429(v=vs.113).aspx https://msdn.microsoft.com/en-us/library/dn314429(v=vs.113)....
It's faster, in memory and multiple people can test simultaneously without contention issues. I've done the whole wrap sql tests in a transaction thing, it was slow and wrought with database locks.
The added advantage is that if you do it right. You not only can switch between different RDMSs you can switch to anything that has a Linq provider. I have a mix of SQL Server and Mongo and the clients don't know the difference they just pass in Expression like (e => e.Id && e.salary > 50000) and it gets translated at runtime to either MongoQuery or Sql. I've switch between the two and they never knew the difference - just update a nuget package.