Adding contraints and inheriting

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi All

A simple question I hope

I have a class

public abstract class authenticatedBoundForm<T> : authenticatedPage,
IControlPage

I want to add contraints to T specifially the new() contraint.

How can I do this without T being forced to inherit/implement
authenticatedPage, IControlPage

Thanks
Paul
 
"Paul" <[email protected]> a écrit dans le message de (e-mail address removed)...

| public abstract class authenticatedBoundForm<T> : authenticatedPage,
| IControlPage
|
| I want to add contraints to T specifially the new() contraint.
|
| How can I do this without T being forced to inherit/implement
| authenticatedPage, IControlPage

public abstract class authenticatedBoundForm<T> : authenticatedPage,
IControlPage where T : new()

T is not affected by the inheritance, only by the constraints.

Joanna
 

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

Back
Top