Esempio n. 1
0
        public void LogUpdateMotorEvent(Motor motor)
        {
            var log = new Settings
                {
                    Active = motor.Activated,
                    Direction = (motor.Rotation == RotationDirection.Clockwise ? "Clockwise" : "AntiClockwise"),
                    Speed = motor.Speed
                };

            using(var session = _factory.OpenSession())
            {
                using(var transaction = session.BeginTransaction())
                {
                    session.SaveOrUpdate(log);
                    transaction.Commit();
                }
            }
        }
Esempio n. 2
0
File: User.cs Progetto: Lasse88/ECH
 public virtual void AddSetting(Settings setting)
 {
     setting.ChangedBy = this;
     Settings.Add(setting);
 }