public async Task HandleAsync(AddFriend command, ICorrelationContext context)
        {
            var model = new UsersFriends()
            {
                FriendId = command.FriendId,
                UserId   = command.UserId
            };

            await _usersFriendsRepository.AddFriend(model);
        }
Esempio n. 2
0
        public async Task HandleAsync(AddFriend command, ICorrelationContext context)
        {
            var model = new UsersFriends()
            {
                FriendId = command.FriendId,
                UserId   = command.UserId
            };

            await _usersFriendsRepository.AddFriend(model);

            await _busPublisher.PublishEventAsync(
                new FriendAdded()
            {
                Id       = command.Id,
                FriendId = command.FriendId,
                UserId   = command.UserId
            }, context);
        }