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

            await _usersFriendsRepository.AddFriend(model);
        }
Exemplo 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);
        }
Exemplo n.º 3
0
 public async Task AddFriend(UsersFriends model)
 {
     await _dbRepository.AddAsync(model);
 }