2011-08-28 129 views
2

一個WCF工作流程使用Ninject很新的對WCF和WF使用Ninject,我目前停留在如何使用屬性注入一個CodeActivity類 例對託管在IIS

public sealed class TestInjection : CodeActivty 
{ 

    [Inject] 
    public IRepository Repository { get; set; } 


    // Define an activity input argument of type string 
    public InArgument<string> Text { get; set; } 

    // If your activity returns a value, derive from CodeActivity<TResult> 
    // and return the value from the Execute method. 
    protected override void Execute(CodeActivityContext context) 
    { 
     // Obtain the runtime value of the Text input argument 
     string text = context.GetValue(this.Text); 
     var name = Repository.GetSomeNAme(); ///Repository is always Null/ never gets injected 
    } 
} 

請幫助!

回答