Ejemplo n.º 1
0
 public Task <Person> CreateAsync(Person value) => DataSvcInvoker.Current.InvokeAsync(this, async() =>
 {
     var __result = await _data.CreateAsync(Check.NotNull(value, nameof(value))).ConfigureAwait(false);
     await(_createOnAfterAsync?.Invoke(__result) ?? Task.CompletedTask).ConfigureAwait(false);
     await _evtPub.PublishValue(__result, new Uri($"/person/{_evtPub.FormatKey(__result)}", UriKind.Relative), $"Demo.Person.{_evtPub.FormatKey(__result)}", "Create").SendAsync().ConfigureAwait(false);
     return(_cache.SetAndReturnValue(__result));
 }, new BusinessInvokerArgs {
     IncludeTransactionScope = true
 });
Ejemplo n.º 2
0
 public Task <Person> CreateAsync(Person value)
 {
     return(DataSvcInvoker.Default.InvokeAsync(this, async() =>
     {
         var __result = await _data.CreateAsync(Check.NotNull(value, nameof(value))).ConfigureAwait(false);
         await Beef.Events.Event.PublishValueEventAsync(__result, "Person", "Created").ConfigureAwait(false);;
         ExecutionContext.Current.CacheSet(__result.UniqueKey, __result);
         if (_OnAfterCreateAsync != null)
         {
             await _OnAfterCreateAsync(__result).ConfigureAwait(false);
         }
         return __result;
     }));
 }
Ejemplo n.º 3
0
 public Task <Person> CreateAsync(Person value)
 {
     return(DataSvcInvoker.Current.InvokeAsync(this, async() =>
     {
         var __result = await _data.CreateAsync(Check.NotNull(value, nameof(value))).ConfigureAwait(false);
         await _evtPub.PublishValueAsync(__result, $"Demo.Person.{__result.Id}", "Create").ConfigureAwait(false);
         _cache.SetValue(__result.UniqueKey, __result);
         if (_createOnAfterAsync != null)
         {
             await _createOnAfterAsync(__result).ConfigureAwait(false);
         }
         return __result;
     }));
 }