namespace TestExtensionMethods
{
public static class MyExtensionMethods
{
public static Int32 GetInt32Value(this string iValue)
{
Int32 iReturnValue = Convert.ToInt32(iValue);
return iReturnValue;
}
}
}
namespace TestExtensionMethods
{
public class TestClass
{
public TestClass()
{
}
private void CheckExtensionValue()
{
string sValue = "12";
int iNewValue = sValue.GetInt32Value();
}
}
}
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)