protected override void PostReloadAction() { Settings = Context.Get<settings>().Single(); }
/// <summary> /// Deprecated Method for adding a new object to the settings EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTosettings(settings settings) { base.AddObject("settings", settings); }
/// <summary> /// Create a new settings object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="guid">Initial value of the guid property.</param> /// <param name="guid2">Initial value of the guid2 property.</param> /// <param name="phmi_guid">Initial value of the phmi_guid property.</param> public static settings Createsettings(global::System.Int32 id, global::System.String guid, global::System.String guid2, global::System.String phmi_guid) { settings settings = new settings(); settings.id = id; settings.guid = guid; settings.guid2 = guid2; settings.phmi_guid = phmi_guid; return settings; }
protected override void EstablishContext() { base.EstablishContext(); Context = new Mock<IModelContext>(); TimeService = new Mock<ITimeService>(); Reporter = new Mock<IReporter>(); ServiceRunnerFactory = new Mock<IServiceRunnerFactory>(); CyclicRunnerFactory = new Mock<ICyclicRunnerFactory>(); IoDeviceRunTargetFactory = new Mock<IIoDeviceRunTargetFactory>(); DataDbCreatorFactory = new Mock<IDataDbCreatorFactory>(); DataDbCreator = new Mock<IDataDbCreator>(); DataDbCreatorFactory.Setup(f => f.Create(DataDbConStr, Reporter.Object)).Returns(DataDbCreator.Object); UsersRunner = new Mock<IUsersRunner>(); UsersRunnerFactory = new Mock<IUsersRunnerFactory>(); UsersRunnerFactory.Setup(f => f.Create(Context.Object, DataDbConStr)).Returns( UsersRunner.Object); AlarmsRunTargetFactory = new Mock<IAlarmsRunTargetFactory>(); TrendsRunTargetFactory = new Mock<ITrendsRunTargetFactory>(); LogRunTargetFactory = new Mock<ILogRunTargetFactory>(); ProjectRunner = new ProjectRunner( ProjectName, Context.Object, TimeService.Object, Reporter.Object, DataDbConStr, DataDbCreatorFactory.Object, UsersRunnerFactory.Object, ServiceRunnerFactory.Object, CyclicRunnerFactory.Object, IoDeviceRunTargetFactory.Object, AlarmsRunTargetFactory.Object, TrendsRunTargetFactory.Object, LogRunTargetFactory.Object); ServiceRunner = new Mock<IRunner>(); ServiceRunnerFactory.Setup(f => f.Create(ProjectRunner, Server, null, TimeService.Object)).Returns(ServiceRunner.Object); Settings = new settings { server = Server }; Context.Setup(c => c.Get<settings>()).Returns(new EnumerableQuery<settings>(new[] { Settings })); }