Visual Studio Item template, choose and implement interface

Viewed 261

I create an item template and this template have to implement an interface.

Current template code:

namespace $rootnamespace$ {
public class $safeitemname$ : ITestA {
    public long? Id { get; set; }
    public string Years { get; set; }
}

I guess, I want to like this;

namespace $rootnamespace$ {
public class $safeitemname$ : $userselectedinterface$ {
    foreach(var prop in $userselectedinterface$.props)
        public prop.Type prop.Name {get; set;}
}

I have multiple interface like ITestA, so I need to create a wizard but how? I do not find any example like that.

How I create a wizard and choose an interface from solution?

1 Answers

you can use multiple inheritance like this:

public class Myclass : ITestA, ITestB {
    public long? Id { get; set; }
    public string Years { get; set; }
}

Then you can implement methods of both parent interfaces.

Related