public virtual async Task Create(IUserService.AddCommand command, CancellationToken cancellationToken = default) { var(user, orUpdate) = command; var existingUser = (User?)null; var context = CommandContext.GetCurrent(); if (Computed.IsInvalidating()) { _ = Get(user.Id, default).AssertCompleted(); existingUser = context.Operation().Items.Get <User>(); if (existingUser == null) { _ = Count(default).AssertCompleted();
public virtual async Task CreateAsync(IUserService.AddCommand command, CancellationToken cancellationToken = default) { var(user, orUpdate) = command; var existingUser = (User?)null; var context = CommandContext.GetCurrent(); if (Computed.IsInvalidating()) { existingUser = context.Items.TryGet <OperationItem <User> >()?.Value; TryGetAsync(user.Id, default).AssertCompleted().Ignore(); if (existingUser == null) { CountAsync(default).AssertCompleted().Ignore();