public deleteSubscription ( Podcatcher.ViewModels.PodcastSubscriptionModel podcastModel ) : void | ||
podcastModel | Podcatcher.ViewModels.PodcastSubscriptionModel | |
Результат | void |
void deleteSubscriptionFromDB(object sender, DoWorkEventArgs e) { PodcastSubscriptionModel podcastModel = e.Argument as PodcastSubscriptionModel; using (var db = new PodcastSqlModel()) { PodcastSubscriptionModel dbSubscription = db.Subscriptions.First(s => s.PodcastId == podcastModel.PodcastId); dbSubscription.cleanupForDeletion(); db.deleteSubscription(dbSubscription); } e.Result = podcastModel; }
public async void deleteSubscription(PodcastSubscriptionModel podcastSubscriptionModel) { OnPodcastChannelDeleteStarted(this, null); await Task.Run(() => { using (var db = new PodcastSqlModel()) { PodcastSubscriptionModel dbSubscription = db.Subscriptions.First(s => s.PodcastId == podcastSubscriptionModel.PodcastId); dbSubscription.cleanupForDeletion(); db.deleteSubscription(dbSubscription); } }); OnPodcastChannelDeleteFinished(this, null); OnPodcastChannelRemoved(podcastSubscriptionModel); }
public async void deleteSubscription(PodcastSubscriptionModel podcastSubscriptionModel) { OnPodcastChannelDeleteStarted(this, null); await Task.Run(() => { using (var db = new PodcastSqlModel()) { PodcastSubscriptionModel dbSubscription = db.Subscriptions.First(s => s.PodcastId == podcastSubscriptionModel.PodcastId); dbSubscription.cleanupForDeletion(); db.deleteSubscription(dbSubscription); } }); OnPodcastChannelDeleteFinished(this, null); OnPodcastChannelRemoved(podcastSubscriptionModel); }
void deleteSubscriptionFromDB(object sender, DoWorkEventArgs e) { PodcastSubscriptionModel podcastModel = e.Argument as PodcastSubscriptionModel; using (var db = new PodcastSqlModel()) { PodcastSubscriptionModel dbSubscription = db.Subscriptions.First(s => s.PodcastId == podcastModel.PodcastId); dbSubscription.cleanupForDeletion(); db.deleteSubscription(dbSubscription); } e.Result = podcastModel; }