Define C# extension method

Category:
Extension Methods
Description: Define C# extension methods
Code:
[< System.Runtime.CompilerServices.ExtensionAttribute >]
[< AutoOpen >]
module ExtensionMethodForCSharp =    
[< System.Runtime.CompilerServices.ExtensionAttribute >]
    let IsFSharp(str:string) = str = "F#"

let ExtensionSample3() = 
    printfn "the method is listed on shown as extension method on C# side" 

Execution Result:
the method is listed on shown as extension method on C# side

Last edited Aug 23, 2012 at 6:16 PM by ttliu2000, version 2

Comments

No comments yet.