G
Guest
Hi.
I am looking something similar to typedef in C++ in C#. Basically, I have a
Person class. Then, I want to declare new type called Beneficiary using the
Person class.
I tried using the following:
using System;
namespace X
{
using Beneficiary = Person;
}
The problem with this is that it only works in the file scope. If I want to
use the class in other files, I have to declare them all over again.
I want to declare once in a file and use them other places just like the
other classes.
Thanks.
J
I am looking something similar to typedef in C++ in C#. Basically, I have a
Person class. Then, I want to declare new type called Beneficiary using the
Person class.
I tried using the following:
using System;
namespace X
{
using Beneficiary = Person;
}
The problem with this is that it only works in the file scope. If I want to
use the class in other files, I have to declare them all over again.
I want to declare once in a file and use them other places just like the
other classes.
Thanks.
J