Is it possible to declare a derived or implemented part of an IEnumerable interface or class as deprecated, while the rest of the class or interface is still relevant? How to declare it?
interface Foo : IEnumerable<Bar>{
int SomethingNonObsolete{
get;
}
}
In the above example, I would like the use of iterators of the implemented IEnumerable to result in an obsolete compiler-warning, while using the interface itself or using SomethingNonObsolete-Property does not result in such a warning.
The following code should result in an outdated compiler warning
foreach(var bar in myFooImplementingInstance){
The following code should not lead to an outdated compiler warning
myFooImplementingInstance.SomethingNonObsolete.ToString()
UPDATE
, , :
, - LINQ.
, Panda , . .
[Obsolete]
IEnumerator<Bar> GetEnumerator()
[Obsolete]
IEnumerator IEnumerable.GetEnumerator()
, . .
[Obsolete]
new IEnumerator<ITabularDataRow> GetEnumerator();
, , , LINQ.
, (. MDeSchaepmeester).