Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent the generated implementation of an interface from using a type alias?

I'm currently using Visual Studio (specifically, 2012 Express). I have an interface already defined as follows:

interface IMyInterface
{
    public String Data { get; set; }
}

If I have an empty class:

class MyClass : IMyInterface
{
}

And I right-click on the IMyInterface, I can select "Implement Interface". When I do this, the auto-generated code produces the following:

class MyClass : IMyInterface
{
    public string Data
    {
        get
        {
            throw new NotImplementedException();
        }
        set
        {
            throw new NotImplementedException();
        }
    }
}

My question is, is there a way that I could have the following auto-generated:

    public String Data

Instead of:

    public string Data

?

like image 210
jdknight Avatar asked Nov 12 '22 06:11

jdknight


1 Answers

There is no way to do this. It's hard-coded to use the builtin aliases where possible.

like image 173
Jay Bazuzi Avatar answered Nov 15 '22 08:11

Jay Bazuzi