Search Results

Search found 2 results on 1 pages for 'derans'.

Page 1/1 | 1 

  • StructureMap Question

    - by derans
    This is the equivalent of what I'm trying to create with StructureMap: new ChangePasswordWithNotificationAndLoggingService( new ChangePasswordService( new ActiveDirectoryRepository(new ActiveDirectoryCredentials()), new TokenRepository("")), new EmailNotificationService(new PasswordChangedNotification(new UserAccount())), new LoggingService()); This is what I have right now: ForRequestedType<IChangePasswordService>() .TheDefault.Is.ConstructedBy(() => new ChangePasswordService(DependencyRegistrar.Resolve<IActiveDirectoryRepository>(), DependencyRegistrar.Resolve<ITokenRepository>())) .EnrichWith<IChangePasswordService>(x => new ChangePasswordWithNotificationAndLoggingService(x, DependencyRegistrar.Resolve<INotificationService>(), DependencyRegistrar.Resolve<ILoggingService>())); I need to pass the UserAccount to the INotificationService...can't figure it out. I've tried this: DependencyRegistrar.With(new UserAccount { Username = "test" }); No luck...UserAccount always turns out null. I don't have to do it all with StructureMap, I'm open to any suggestions. This is what I currently have working: public static IChangePasswordService ChangePasswordService(UserAccount userAccount) { return new ChangePasswordWithNotificationService( new ChangePasswordService(ActiveDirectoryRepository(), TokenRepository()), new EmailNotificationService(new PasswordChangedNotification(userAccount))); }

    Read the article

  • No supported translation to SQL

    - by derans
    We have this code: private IList<InfoRequest> GetBy(Func<InformationRequest, string> func, string searchby) { var requests = _dc.InformationRequests .Where(x => func.Invoke(x).Contains(searchby)) .OrderBy(y => y.RequestDate); return Mapper.Map<InformationRequest[], InfoRequest[]>(requests.ToArray()); } It continues to throw the no supported translation to SQL error. Any ideas on the problem or how to resolve it?

    Read the article

1