private void RiseItemPublished(object sender, PublishedItem e) { e.Publisher = sender as Publisher; var temp = System.Threading.Volatile.Read(ref ItemPublished); ItemPublished?.Invoke(sender, e); exportRepository?.Add(e); }
public async Task <bool> RemovePublishedAsync(PublishedItem publishedItem) { if (!CanPublishSubjects) { throw new InvalidOperationException("The database of exported items is not available"); } if (!await publishedItem.Publisher?.RemoveAsync(publishedItem)) { return(false); } exportRepository?.RemoveAsync(publishedItem); await exportRepository?.SaveChangesAsync(); return(true); }
protected virtual void OnItemPublished(PublishedItem e) { var temp = System.Threading.Volatile.Read(ref ItemPublished); ItemPublished?.Invoke(this, e); }
internal protected abstract Task <bool> RemoveAsync(PublishedItem publishedItem);