Please ignore, I am smoking crack. I had it figured out after all….

 

public class PersistenceManager<T, K> : IPersistenceManager<T, K> where K:
new() 

{ } 

 

Sorry!

Jason

   _____  

From: Jason Bunting [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 10, 2006 3:38 PM
To: '[email protected]'
Subject: Syntax for type parameter constraints for a class that implements a
generic interface...

 

Here is the situation I am facing:

 

I have an interface, declared like so:

 

          public interface IPersistenceManager<T, K> 

          {

                   ...

          }

 

I then have a generic class definition:

 

          public class MyPersistenceManager<T, K> : IPersistenceManager<T,
K>

          {

                   ...

          }

 

My problem is that I need to specify type parameter constraints on the
class, which would normally look like this:

 

          public class PersistenceManager<T, K> where K: new()

          {

                   ...

          }

          

But how do you then specify that this class implements the
IPersistenceManager<T, K> interface? The syntax is not obvious to me, and
the few things I have tried do not work. I have looked at the documentation
to no avail. Any ideas?

 

Thanks,

Jason Bunting

 


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/336 - Release Date: 5/10/2006



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/336 - Release Date: 5/10/2006
 

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to