Well, thatโs not entirely true. If the interfaces let you declare the fields, this will be the state. Since the property is just syntactic sugar for the get and set methods, this is allowed.
Here is an example:
interface IFoo { Object Foo { get; set; } }
The previous interface compiles to the following IL:
.class private interface abstract auto ansi IFoo { .property instance object Foo { .get instance object IFoo::get_Foo() .set instance void IFoo::set_Foo(object) } }
As you can see, even the interface sees the property as methods.
source share