public virtual void OnTurnedOn(TurnedOnEventArgs e) { _tvState.IsOn = true; _tvState.Version = e.Version; dataContext.Update(_tvState, x => x.IsOn, x => x.Version); dataContext.Commit(); Console.WriteLine("TurnedOnEventArgs"); }
/// <summary>Turns the television on.</summary> /// <exception cref="InvalidOperationException">The television is currently on.</exception> public void TurnOn() { if (IsOn) { throw new InvalidOperationException("The television is currently on and cannot be turned on again."); } TurnedOnEventArgs e = new TurnedOnEventArgs(); EntityState.Apply(e); }
protected virtual void OnTurnedOn(TurnedOnEventArgs e) { IsOn = true; }