Пример #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
 });
Пример #2
0
 public Task <Employee> CreateAsync(Employee value) => _db.EventOutboxInvoker.InvokeAsync(this, async() =>
 {
     var __result = await CreateOnImplementationAsync(Check.NotNull(value, nameof(value))).ConfigureAwait(false);
     _evtPub.PublishValue(__result, new Uri($"my/hr/employee/{_evtPub.FormatKey(__result)}", UriKind.Relative), $"my.hr.employee", "created");
     return(__result);
 });
Пример #3
0
 public Task <PostalInfo> CreatePostCodesAsync(PostalInfo value, RefDataNamespace.Country?country, string?state, string?city) => DataSvcInvoker.Current.InvokeAsync(this, async() =>
 {
     var __result = await _data.CreatePostCodesAsync(Check.NotNull(value, nameof(value)), country, state, city).ConfigureAwait(false);
     await _evtPub.PublishValue(__result, new Uri($"/postalinfo/{_evtPub.FormatKey(__result)}", UriKind.Relative), $"Demo.PostalInfo.{_evtPub.FormatKey(__result)}", "Create", country.Code, state, city).SendAsync().ConfigureAwait(false);
     return(__result);
 });