Beispiel #1
0
 public Task DeleteAsync(Guid id) => DataSvcInvoker.Current.InvokeAsync(this, async() =>
 {
     await _data.DeleteAsync(id).ConfigureAwait(false);
     await(_deleteOnAfterAsync?.Invoke(id) ?? Task.CompletedTask).ConfigureAwait(false);
     await _evtPub.PublishValue(new Person {
         Id = id
     }, new Uri($"/person/{_evtPub.FormatKey(id)}", UriKind.Relative), $"Demo.Person.{_evtPub.FormatKey(id)}", "Delete", id).SendAsync().ConfigureAwait(false);
     _cache.Remove <Person>(new UniqueKey(id));
 }, new BusinessInvokerArgs {
     IncludeTransactionScope = true
 });
Beispiel #2
0
 public Task DeleteAsync(Guid id)
 {
     return(DataSvcInvoker.Current.InvokeAsync(this, async() =>
     {
         await _data.DeleteAsync(id).ConfigureAwait(false);
         await _evtPub.PublishAsync($"Demo.Person.{id}", "Delete", id).ConfigureAwait(false);
         _cache.Remove <Person>(new UniqueKey(id));
         if (_deleteOnAfterAsync != null)
         {
             await _deleteOnAfterAsync(id).ConfigureAwait(false);
         }
     }));
 }