Print Page | Close Window

MethodDef has IsOverload property, but no IsVirtual property?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2061
Printed Date: 09-Oct-2025 at 3:36pm


Topic: MethodDef has IsOverload property, but no IsVirtual property?
Posted By: robert.hui
Subject: MethodDef has IsOverload property, but no IsVirtual property?
Date Posted: 11-Aug-2010 at 2:39pm
There's a bit of trouble I'm running into with setting up unit tests for logic that queries from an EntityManager.

I've been able to stub dummy entities into a disconnected EntityManager, but there's one piece of code that calls to a stored procedure, and this isn't allowed in a disconnected state.

I'd like to code-generate the method call to invoke the stored procedure as a virtual method so that we can override it in test scenarios to return dummy data, instead of trying to connect to a database.

My question is, why does the MethodDef class contain an IsOverload property, but no IsVirtualProperty? Is this planned for a future release?

I'm also open to alternatives ways to test this scenario where a stored procedure call needs to be dummied for testing purposes.



Replies:
Posted By: ting
Date Posted: 11-Aug-2010 at 6:30pm

Yes, we will provide IsVirtual on the class.  This should make the next release.



Posted By: robert.hui
Date Posted: 13-Aug-2010 at 9:34am
That's great to hear. After more digging around, I noticed that the IsOverride property only applies to VB, whereas we use C#. Will this IsVirtual property be applicable to C#?


Posted By: ting
Date Posted: 13-Aug-2010 at 4:46pm
Yes, we'll make it applicable for both languages.



Print Page | Close Window