Windows Vista Forums

Extension Method Question for ServicedComponent
  1. #1


    coconet Guest

    Extension Method Question for ServicedComponent

    ..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.


      My System SpecsSystem Spec

  2. #2


    Anthony Jones Guest

    Re: Extension Method Question for ServicedComponent

    "coconet" <coconet@xxxxxx> wrote in message
    news:g2dgv3l28lev12mj6g0rmjvj3kflltc7ls@xxxxxx

    > .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



      My System SpecsSystem Spec

Extension Method Question for ServicedComponent problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about Copy() method in Excel Michael Gao PowerShell 0 08 Jul 2008
method not many USER Vista mail 0 25 Jun 2008
Method invocation failed because [System.String] doesn't contain a method B Williams PowerShell 0 31 Mar 2008
XAML extension question Lloyd Dupont Avalon 7 07 Jul 2007
Question about passing array to a .Net method =?Utf-8?B?TWlrZSBCcmlkZ2U=?= bridgecanada _ com> PowerShell 3 07 Oct 2006