private void EntityChangeObserver_Changed(object sender, EntityChangeEventArgs e) { if (e.Entry.Entity.GetType() != typeof(BlogSettings)) { return; } Thread.Sleep(_source.ReloadDelay); Load(); }
/// <summary> /// Let the EntityChangeObserver know an entity has changed. /// </summary> /// <param name="e">Event arguments for events relating to tracked Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntrys.</param> public void OnChanged(EntityChangeEventArgs e) { ThreadPool.QueueUserWorkItem((_) => Changed?.Invoke(this, e)); }