2 ms·
You can, and you should. http://tsqlt.org http://tsqlt.org Being able to write decent unit test suites is one of the biggest things that moved me from inline
by bunderbunder 9y ago
You can, and you should. http://tsqlt.org http://tsqlt.org
Being able to write decent unit test suites is one of the biggest things that moved me from inline SQL back toward sprocs.
- scarface74 9y agoI 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.