protected TransactionalCommandTask(Func<bool> canExecute) { if (canExecute == null) throw new ArgumentNullException(nameof(canExecute)); _canExecute = canExecute; _dataContextManager = SimpleIoc.Default.GetInstance<IDataContextManager>(); }
public RepositoryBase(IDataContextManager dataContextManager) { if (dataContextManager == null) { throw new ArgumentNullException(nameof(dataContextManager)); } _dataContextManager = dataContextManager; }
protected override void Arrange() { DataContextManager = new DataContextManager(); DataContextManager.RefreshSettingsDataContext().Wait(); var switchableDevice = new Device { Identifier = Guid.NewGuid(), Name = "switchable device", Capability = DeviceCapability.Switchable, Type = DeviceType.Fifthplay }; var unsupportedDevice = new Device { Identifier = Guid.NewGuid(), Name = "unsupported device", Capability = DeviceCapability.None, Type = DeviceType.Ifttt }; DataContextManager.SettingsDataContext.IsApplicationEnabled = true; DataContextManager.SettingsDataContext.Devices = new List <Device> { switchableDevice, unsupportedDevice }; DataContextManager.SettingsDataContext.Actions = new List <Business.Model.Action> { new Business.Model.Action { Identifier = Guid.NewGuid(), DeviceIdentifier = switchableDevice.Identifier, ActionTypeIdentifier = DataContextManager.SettingsDataContext.ActionTypes.First().Identifer, ActionArgumentIdentifier = DataContextManager.SettingsDataContext.ActionTypes.First().ActionArguments.First().Identifer, ActionTrigger = ActionTrigger.Home }, new Business.Model.Action { Identifier = Guid.NewGuid(), DeviceIdentifier = unsupportedDevice.Identifier, ActionTypeIdentifier = DataContextManager.SettingsDataContext.ActionTypes.First().Identifer, ActionArgumentIdentifier = DataContextManager.SettingsDataContext.ActionTypes.First().ActionArguments.ElementAt(1).Identifer, ActionTrigger = ActionTrigger.Away } }; DataContextManager.SettingsDataContext.Logs.Add(new ActionLog { Identifier = Guid.NewGuid(), ActionArgumentValue = "on", Type = "Home", ActionTypeName = "switch", DeviceName = "dummy device", Timestamp = DateTimeOffset.UtcNow }); DataContextManager.SettingsDataContext.Logs.Add(new ActionLog { Identifier = new Guid("6fd4aa18-e36c-493c-815d-d4e1e8ed675f"), ActionArgumentValue = "on", Type = "Home", ActionTypeName = "switch", DeviceName = "Desk lamp", Timestamp = DateTimeOffset.UtcNow }); DataContextManager.SettingsDataContext.Logs.Add(new FailedActionLog { Identifier = Guid.NewGuid(), ActionArgumentValue = "on", Type = "Home", ActionTypeName = "switch", DeviceName = "dummy device", Timestamp = DateTimeOffset.UtcNow, Error = "dummy-error" }); DataContextManager.SettingsDataContext.Logs.Add(new FailedActionLog { Identifier = Guid.NewGuid(), ActionArgumentValue = "on", Type = "Home", ActionTypeName = "switch", DeviceName = "dummy device", Timestamp = DateTimeOffset.UtcNow, Error = "dummy-error" }); DataContextManager.SettingsDataContext.Logs.Add(new ExceptionLog { Identifier = Guid.NewGuid(), Error = new Exception().ToString(), Timestamp = DateTimeOffset.UtcNow }); DataContextManager.SettingsDataContext.Logs.Add(new ExceptionLog { Identifier = Guid.NewGuid(), Error = "dummy-error", Timestamp = DateTimeOffset.UtcNow }); }
public GeofenceBackgroundTask() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); SimpleIoc.Default.ConfigureBusiness(); _dataContextManager = SimpleIoc.Default.GetInstance <IDataContextManager>(); _actionExecutor = SimpleIoc.Default.GetInstance <IActionExecutor>(); _logger = SimpleIoc.Default.GetInstance <ILogger>(); }
public GeofenceBackgroundTask() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); SimpleIoc.Default.ConfigureBusiness(); _dataContextManager = SimpleIoc.Default.GetInstance<IDataContextManager>(); _actionExecutor = SimpleIoc.Default.GetInstance<IActionExecutor>(); _logger = SimpleIoc.Default.GetInstance<ILogger>(); }
protected TransactionalCommandTask(Func <bool> canExecute) { if (canExecute == null) { throw new ArgumentNullException(nameof(canExecute)); } _canExecute = canExecute; _dataContextManager = SimpleIoc.Default.GetInstance <IDataContextManager>(); }
protected override void Arrange() { DataContextManager = new DataContextManager(); DataContextManager.RefreshSettingsDataContext().Wait(); var switchableDevice = new Device { Identifier = Guid.NewGuid(), Name = "switchable device", Capability = DeviceCapability.Switchable, Type = DeviceType.Fifthplay }; var unsupportedDevice = new Device { Identifier = Guid.NewGuid(), Name = "unsupported device", Capability = DeviceCapability.None, Type = DeviceType.Ifttt }; DataContextManager.SettingsDataContext.IsApplicationEnabled = true; DataContextManager.SettingsDataContext.Devices = new List<Device> { switchableDevice, unsupportedDevice }; DataContextManager.SettingsDataContext.Actions = new List<Business.Model.Action> { new Business.Model.Action { Identifier = Guid.NewGuid(), DeviceIdentifier = switchableDevice.Identifier, ActionTypeIdentifier = DataContextManager.SettingsDataContext.ActionTypes.First().Identifer, ActionArgumentIdentifier = DataContextManager.SettingsDataContext.ActionTypes.First().ActionArguments.First().Identifer, ActionTrigger = ActionTrigger.Home }, new Business.Model.Action { Identifier = Guid.NewGuid(), DeviceIdentifier = unsupportedDevice.Identifier, ActionTypeIdentifier = DataContextManager.SettingsDataContext.ActionTypes.First().Identifer, ActionArgumentIdentifier = DataContextManager.SettingsDataContext.ActionTypes.First().ActionArguments.ElementAt(1).Identifer, ActionTrigger = ActionTrigger.Away } }; DataContextManager.SettingsDataContext.Logs.Add(new ActionLog { Identifier = Guid.NewGuid(), ActionArgumentValue = "on", Type = "Home", ActionTypeName = "switch", DeviceName = "dummy device", Timestamp = DateTimeOffset.UtcNow }); DataContextManager.SettingsDataContext.Logs.Add(new ActionLog { Identifier = new Guid("6fd4aa18-e36c-493c-815d-d4e1e8ed675f"), ActionArgumentValue = "on", Type = "Home", ActionTypeName = "switch", DeviceName = "Desk lamp", Timestamp = DateTimeOffset.UtcNow }); DataContextManager.SettingsDataContext.Logs.Add(new FailedActionLog { Identifier = Guid.NewGuid(), ActionArgumentValue = "on", Type = "Home", ActionTypeName = "switch", DeviceName = "dummy device", Timestamp = DateTimeOffset.UtcNow, Error = "dummy-error" }); DataContextManager.SettingsDataContext.Logs.Add(new FailedActionLog { Identifier = Guid.NewGuid(), ActionArgumentValue = "on", Type = "Home", ActionTypeName = "switch", DeviceName = "dummy device", Timestamp = DateTimeOffset.UtcNow, Error = "dummy-error" }); DataContextManager.SettingsDataContext.Logs.Add(new ExceptionLog { Identifier = Guid.NewGuid(), Error = new Exception().ToString(), Timestamp = DateTimeOffset.UtcNow }); DataContextManager.SettingsDataContext.Logs.Add(new ExceptionLog { Identifier = Guid.NewGuid(), Error = "dummy-error", Timestamp = DateTimeOffset.UtcNow }); }
public ExampleController(IDataContextManager <ExampleDbContext> manager, IGenericRepository <UserEntity> repository) { this.manager = manager; this.repository = repository; }
public DeviceRepository(IDataContextManager dataContextManager) : base(dataContextManager) { }
public LogRepository(IDataContextManager dataContextManager) : base(dataContextManager) { }
public ActionTypeRepository(IDataContextManager dataContextManager) : base(dataContextManager) { }
public ActionRepository(IDataContextManager dataContextManager) : base(dataContextManager) { }
public EFGenericRepositoryExample(IDataContextManager <ExampleDbContext> manager) { this.manager = manager; }
public RepositoryBase(IDataContextManager dataContextManager) { if (dataContextManager == null) throw new ArgumentNullException(nameof(dataContextManager)); _dataContextManager = dataContextManager; }
public AbstractService(IDataContextManager dataContextManager, IUnityContainer container) { DataContextManager = dataContextManager; MapperFactory = new MapperFactory(container); }
public ApplicationRepository(IDataContextManager dataContextManager) : base(dataContextManager) { }
public ConvenienceViewModelBase() { _navigationService = ServiceLocator.Current.GetInstance<INavigationService>(); _dataContextManager = ServiceLocator.Current.GetInstance<IDataContextManager>(); IsLoading = false; }
public ConvenienceViewModelBase() { _navigationService = ServiceLocator.Current.GetInstance <INavigationService>(); _dataContextManager = ServiceLocator.Current.GetInstance <IDataContextManager>(); IsLoading = false; }