Extension Method Question for ServicedComponent

Extension Method Question for ServicedComponent

am 06.04.2008 04:28:24 von coconet

..NET 3.5
If I understand correctly, extension methods must be in a public
static class. I have some code that executes in a COM+ application for
object pooling purposes. I am trying to update it by using LINQ and an
extension method. I think my code that inherits from ServicedComponent
cannot have any public static code, all methods must be instance
methods.

How can I make this stuff all work together?


Thanks.

Re: Extension Method Question for ServicedComponent

am 06.04.2008 22:23:33 von Anthony Jones

"coconet" wrote in message
news:g2dgv3l28lev12mj6g0rmjvj3kflltc7ls@4ax.com...
> .NET 3.5
> If I understand correctly, extension methods must be in a public
> static class. I have some code that executes in a COM+ application for
> object pooling purposes. I am trying to update it by using LINQ and an
> extension method. I think my code that inherits from ServicedComponent
> cannot have any public static code, all methods must be instance
> methods.
>
> How can I make this stuff all work together?
>

If I've understood your question correctly I don't think you can.

You will need to create additional interfaces to expose your new methods,
extension methods are not callable via COM since COM requires an interface.

--
Anthony Jones - MVP ASP/ASP.NET