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?
public partial class Foo : IFoo
{
}
Since Bar
property already exists, it wont be needed to reimplement it.
Or in a new class
public class FooExtended : Foo, IFoo
{
}
Again, you won't need to implement Bar
since Foo implements it already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With