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

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
 
C

Cor Ligthert[MVP]

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
 
C

Cor Ligthert[MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top