Author: ldechent | Posted on: 3/9/2009 9:27:44 AM | Views : 271

I have a simple namespace example that creates a property, .TakeFive() and it will subtract 5 from an integer.

if an integer nine = 9 then

nine.TakeFive() is 4

It works in C# but I am stuck with translating it to VB (and probably something simple, and probably mixing something C# that is not appropriate in VB).  Thank you for looking at this.

 

In the App_Code folder I have ExtensionMethods.vb,with

 Imports Microsoft.VisualBasic


Namespace CustomExtensions

Public Class IntExtension

Public Function TakeFive(ByVal this As Integer) As Integer

Dim answer As Integer = this - 5
Return answer

Go to the complete details ...