Open GoogleCodeExporter opened 9 years ago
WARNING! I've since found that LINQ to SQL emits different SQL at times if the
context object is declared as the interface. So I have abandoned the use of
this
concoction.
Original comment by tyler.je...@gmail.com
on 27 Aug 2009 at 4:20
What did you end up going with? Is there another solution to this problem?
Original comment by shannon....@gmail.com
on 28 Aug 2009 at 4:09
http://blogs.msdn.com/mattwar/archive/2008/05/04/mocks-nix-an-extensible-linq-to
-sql-
datacontext.aspx
With a minor fix to support the IDisposable Dispose method call:
//fix from original: check for IDisposable as well as the IProvider calls
if ((call.MethodBase.DeclaringType.Name == "IDisposable" ||
call.MethodBase.DeclaringType.Name == "IProvider") &&
call.MethodBase.DeclaringType.IsInterface)
It's not terribly pretty, but it does allow you to "mock" or "fake" the context
in a
test.
Original comment by tyler.je...@gmail.com
on 28 Aug 2009 at 4:13
Original comment by shannon....@gmail.com
on 18 Sep 2009 at 4:47
Original issue reported on code.google.com by
tyler.je...@gmail.com
on 17 Aug 2009 at 7:13Attachments: