Prevent developers from using certain methods of the core .NETclasses?

  • Thread starter Thread starter mlanza
  • Start date Start date
M

mlanza

Our shop wants to enforce standards and sometimes we write an
extension methods meant to be used in place of another method. For
example, we have our own version of DataTable.Select named SelectRows
that helps us enforce certain standards.

Is there a way to provide a compile time warning on the use of the
method we wish to deprecate? The obsolete attribute works for classes
we wrote ourselves, but I'm not sure if it can be applied to the
methods of the core .NET classes.

We want to use the native classes like DataTable, etc. We don't want
to create an inherited version of such classes in order to hide/
deprecate certain methods.

Thanks,
Mario T. Lanza
2009.05
 
nlanze,

You are sure you want an extension methods and not simple an extension to
your datatable class.

extend a class goes with a partial class.

However, as it is about extension methods, then a better newsgroup to ask
this are the separated newsgroups per languages.

Microsoft.public.dotNet.languages.vb (or csharp or vc)

Cor
 
nlanze,

You are sure you want an extension methods and not simple an extension to
your datatable class.

extend a class goes with a partial class.

However, as it is about extension methods, then a better newsgroup to ask
this are the separated newsgroups per languages.

Microsoft.public.dotNet.languages.vb (or csharp or vc)

Cor
 
Back
Top