public DefaultContext() { var connectionString = ConfigurationManager.ConnectionStrings[CONNECTION_KEY].ToString(); this.Factory = UnitySetup.CreateFactory(this); this.DataContext = this.Factory.GetService <IDataContext>(connectionString); }
static void DidReloadScripts() { UnitySetup.SetupDefaultSingletonsIfNeeded(); // Logd(" !! UnityEditor.Callbacks.DidReloadScripts"); try { new SoundPlayer("C:/CompileSuccess.wav").Play(); } catch (Exception e) { Logd("Add a C:/CompileSuccess.wav to get better compile feedback, " + e); } }
public ConsumerContext() { var connectionString = ConfigurationManager.ConnectionStrings[CONNECTION_KEY].ToString(); Factory = UnitySetup.CreateFactory(this); DataContext = Factory.GetService <IDbContext>(connectionString); }
static void DidReloadScripts() { Logd(" !! UnityEditor.Callbacks.DidReloadScripts"); UnitySetup.ResetAllStaticObjects(); try { new SoundPlayer("C:/CompileSuccess.wav").Play(); } catch (Exception e) { Logd("Add a C:/CompileSuccess.wav to get better compile feedback, " + e); } }
public SenderContext() { var connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; Factory = UnitySetup.CreateFactory(this); DataContext = Factory.GetService<IDbContext>(connectionString); }
private static void ResetStaticInstances() { DisposeAllInjectors(); EventBus.instance = new EventBus(); IoC.inject = new injection.Injector(); UnitySetup.SetupDefaultSingletonsIfNeeded(); }
private static void ResetStaticInstances() { AssertV2.throwExeptionIfAssertionFails = false; DisposeAllInjectors(); EventBus.instance = new EventBus(); IoC.inject = new injection.Injector(); UnitySetup.ResetAllStaticObjects(); }
public DefaultContext() : base() { var connectionString = ConfigurationManager.ConnectionStrings[ConnectionKey].ToString(); this.Factory = UnitySetup.CreateFactory(this); this.DataContext = this.Factory.GetService <IDataContext>(connectionString); this.Logger = LoggerSelector.Instance; }
public DefaultContext(GenericPrincipal prinipical, HttpContextBase requestContext) : base() { var connectionString = ConfigurationManager.ConnectionStrings[ConnectionKey].ToString(); this._prinipical = prinipical; this.Factory = UnitySetup.CreateFactory(this); this.DataContext = this.Factory.GetService <IDataContext>(connectionString); this.Logger = LoggerSelector.Instance; }
public AutoMapperTest() { Setup(); _mockedService = new Mock <MarsRoverService>(UnitySetup.Resolve <IApplicationSettings>()) { CallBase = true }; _roverInput = new RoverImageInputDto() { ImageDate = new DateTime(2016, 1, 1) }; }
static void SetupAllMyInjections() { // In here the injection setup can be done AFTER the generic UnitySetup finished its own setup: UnitySetup.InvokeAfterUnitySetupDone(() => { var injector1 = new object(); IoC.inject.RegisterInjector <MyExampleClass1ToInject>(injector1, (requester, createIfNull) => { return(new MyExampleClass1ToInject() { myString = "Handled by MyExampleInjectionSetup" }); }); // .. here more injectors would be registered for other classes .. // }); }
public override int Run(string[] remainingArguments) { try { var stopWatch = new Stopwatch(); stopWatch.Start(); var roverImageArchiver = UnitySetup.Resolve <IRoverImageArchiver>(); var task = Task.Run(() => roverImageArchiver.ArchiveImages(FileLocation)); task.Wait(); stopWatch.Stop(); Log.Information($"Total Elasped Time in sec {stopWatch.Elapsed.TotalSeconds}"); return((int)task.Result); } catch (Exception e) { Log.Error(e, "DownloadRoverImagesCommand.Run"); return((int)ExitCode.UnknownError); } }
public RootContext(string connectionString, IMapper mapper) { this.connectionString = connectionString; this.factory = UnitySetup.CreateServiceProviderFactory(); this.mapper = new MapperService(mapper); }
public void Setup() { AutoMapperConfig.Initialize(); UnitySetup.RegisterComponents(); }
public MarsRoverServiceTest() { Setup(); _marsRoverService = new MarsRoverService(UnitySetup.Resolve <IApplicationSettings>()); }
static void DidReloadScripts() { UnitySetup.SetupDefaultSingletonsIfNeeded(); Logd(" !! UnityEditor.Callbacks.DidReloadScripts"); try { new SoundPlayer("C:/CompileSuccess.wav").Play(); } catch (Exception e) { Debug.LogWarning(e); } }
private static void StartUp() { UnitySetup.RegisterComponents(); AutoMapperConfig.Initialize(); }
public RootContext() { Factory = UnitySetup.CreateFactory(this); DataContext = Factory.GetService <IDbContext>(); }
public static void RegisterComponents() { UnitySetup.RegisterWebApiComponents(); GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(UnitySetup.GetContainer()); }