Exemple #1
0
        public override async Task OnInitializeAsync(IActivatedEventArgs args)
        {
            var dataService = new DataService(new StorageService());
            var data        = await dataService.GetDataAsync();

            UnityContainer.RegisterType <IAnalyticsClient, AnalyticsClient>();
            UnityContainer.RegisterType <IOAuthClient, OAuthClient>();
            UnityContainer.RegisterType <IAccountRepository, AccountRepository>(new InjectionConstructor(data.Accounts));
            UnityContainer.RegisterType <IApplicationRepository, ApplicationRepository>(new InjectionConstructor(data.Applications));
            UnityContainer.RegisterType <IApplicationMarketRepository, ApplicationMarketRepository>(new InjectionConstructor(data.Markets));
            UnityContainer.RegisterType <IReviewRepository, ReviewRepository>(new InjectionConstructor(data.Reviews));
            UnityContainer.RegisterType <IAccountService, AccountService>();

            var fake = new FakeService();
            await fake.AddFakeAccounts(UnityContainer.Resolve <IAccountRepository>(), UnityContainer.Resolve <IApplicationRepository> (), UnityContainer.Resolve <IApplicationMarketRepository> (), UnityContainer.Resolve <IReviewRepository> ());
        }