Esempio n. 1
0
    public Task <UserId> AddOnCallUserAsync(OnCallProviderId onCallProviderId, EmailAddressDto email)
    {
        return(CommandAsync(
                   Authorize.Unauthenticated,
                   () =>
        {
            var onCallUser = new OnCallUser(
                onCallProviderId,
                email.ToValueObject()
                );

            _userRepo.Add(onCallUser);
            return Task.FromResult(onCallUser.Id);
        }
                   ));
    }
Esempio n. 2
0
    public Task <UserId> AddCustomerUserAsync(CustomerId customerId, EmailAddressDto email)
    {
        return(CommandAsync(
                   Authorize.Unauthenticated,
                   () =>
        {
            var customerUser = new CustomerUser(
                customerId,
                email.ToValueObject()
                );

            _userRepo.Add(customerUser);
            return Task.FromResult(customerUser.Id);
        }
                   ));
    }