I have a partial class being generated by a tool.
Foo.cs
public partial class Foo {
[SomeAttribute()]
public string Bar {get;set;}
}
I need to implement the following interface for Foo without touching Foo.cs:
IFoo.cs
public interface IFoo {
string Bar {get;set;}
}
Extending Foo is also an option, but re-implementing the Bar property isn’t.
Can this be done?
What prevents you from doing this again in another file?
Since
Barproperty already exists, it wont be needed to reimplement it.Or in a new class
Again, you won’t need to implement
Barsince Foo implements it already.