StructureMap Question -


is equal to it is trying to make with Strccrmap:

< pre> new ChangePasswordWithNotificationAndLoggingService (new ChangePasswordService (new ActiveDirectoryRepository (new ActiveDirectoryCredentials ()), new TokenRepository ( "")), new EmailNotificationService (new PasswordChangedNotification (new user account ())), new LoggingService ());

I have it right now:

  ForRequestedType & lt; IChangePasswordService & gt; (). Default.is. Constrkt the (() = & gt; New ChangePasswordService (DependencyRegistrar.Resolve & LT; IActiveDirectoryRepository & gt; (), DependencyRegistrar.Resolve & LT; ITokenRepository & gt; ())) .EnrichWith & LT made; IChangePasswordService & gt; (X = & gt; New ChangePasswordWithNotificationAndLoggingService (X, DependencyRegistrar.Resolve & LT; INotificationService & gt; (), DependencyRegistrar.Resolve & LT; ILoggingService & gt; ()));  

I have to pass user anonymization on the information service ... it can not understand.

I've tried to do it: DependencyRegistrar.With (new UserAccount {username = "test"});

No luck ... UserAccount always comes out empty. I do not have to do all this with StructureMap, I'm open to any suggestions.

This is what I am currently working at:

  public static IChangePasswordService ChangePasswordService (UserAccount userAccount) {new change notification service with passwordword (new password change service Service (Active Directory Repository), TokenRipository ()), New Email Notification Service (new password change notification (user account)); }  

Have you tried to use it now? With these simple constructions, all solid squares can then detect StructureMap that is what you need

 for . & Lt; IChangePasswordService & gt; Use (). & Lt; ChangePasswordService & gt; ();  

Seeing your creation, I think this simple configuration can only work

edit about comments

>

You must use the provided container to create your own ICSEG password service using the account.

var userAccount = New UserAccount ("derans"); Var change password service = container. (User account) .GetInstance & lt; IChangePasswordService & gt; ();

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -