hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

Named parameters in an interface?

Last post 07-22-2008, 0:44 by Robert. 1 replies.
Sort Posts: Previous Next
  •  07-21-2008, 18:17 6419

    Named parameters in an interface?

    If I define an interface like this:

     type IFoo =
      interface
       abstract Method: int*string -> string
      end

    then the resulting signature (as seen in reflector) is

    interface IFoo
    {
      string Method( int, string );
    }

    Note absence of parameter names (well, I did not specify any, did I).
    When I try to expose this interface as a WCF contract, WCF does not like it. It is not designed for parameters without a name, and throws an ArgumentNullException.

    Question: how do I define parameter names for an interface method?

    abstract member Method(x:int, y:string) -> string

    does not work

    TIA
  •  07-22-2008, 0:44 6421 in reply to 6419

    Re: Named parameters in an interface?

    Yes, I too was bitten by this when trying to use F# and WCF. You can name your parameters if you want to:

    type IFoo = interface
        abstract Method: foo:int * bar:string -> string
    end


    Robert Pickering, MVP
    http://strangelights.com
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems