public static ServiceFactoryHelper Create() { var serviceStub = new CustomerServiceStub(); var customerServiceFactory = new DemoProxyFactory<ICustomerService>(serviceStub); var serviceFactory = new ServiceFactory<ICustomerService>(() => customerServiceFactory.Create()); var factory = new ServiceFactoryHelper(serviceFactory, serviceStub); return factory; }
public ViewModelCompleted(ServiceFactoryHelper factoryHelper, ManualResetEvent manualResetEvent) { factoryHelper .ServiceFactory .Collection(this, x => x.CustomerCollection) .Fill(x => x.GetCustomersWithTurnoverGreatherThan(0)) .Completed(x => { Completed = x.First().Id; manualResetEvent.Set(); }); }