static SharedSettings() { refitSettings = new RefitSettings(); restServiceBuilder = RestServiceBuilder .WithAutoRetry() .WithCaching() .WithRefitSettings(SharedSettings.RefitSettings); RestService = restServiceBuilder.BuildRestService(typeof(App).GetTypeInfo().Assembly); }
public override void Initialize() { CreatableTypes() .EndingWith("Service") .AsInterfaces() .RegisterAsLazySingleton(); Mvx.RegisterType <MainViewModel>(() => new MainViewModel(Mvx.Resolve <IRestService>())); Mvx.RegisterType <ClientDetailsViewModel>(() => new ClientDetailsViewModel(Mvx.Resolve <IRestService>())); BaseApiConfiguration.ApiUri = new Uri("http://apitestprezentacja.azurewebsites.net/"); Mvx.RegisterType <IRestService>(() => { var restServiceBuilder = new RestServiceBuilder() .WithCaching() .WithAutoRetry(); return(restServiceBuilder.BuildRestService(typeof(App).GetTypeInfo().Assembly)); }); RegisterAppStart <MainViewModel>(); }