Szybkie pytanie ...C# danych Adnotacje w interfejsie
Jeśli mogę umieścić zapis w interfejsie ...
Say [Wymagane]
mogę ommit że zapis w klasie C# własność?
czyli mogę ...
Interface IFoo
{
[Required]
string Bar {get; set;}
}
Class Foo : IFoo
{
string Bar {get; set;}
}
czy muszę po prostu nie umieścić zapis w interfejsie i to zrobić ...
Interface IFoo
{
string Bar {get; set;}
}
Class Foo : IFoo
{
[Required]
string Bar {get; set;}
}
To musi iść na zajęcia. Zobacz: http://bradwilson.typepad.com/blog/2011/08/interface-attributes-class-attributes.html –