Beispiel #1
0
        public async Task AddOrRemoveListingFromFavoritesAsync(long listingId, bool isFavorite)
        {
            User user = await userManager.FindByEmailAsync(User.Identity.Name);

            var command = new AddOrRemoveListingFromFavoritesCommand
            {
                UserId     = user.Id,
                ListingId  = listingId,
                IsFavorite = isFavorite
            };

            await pipelineService.HandleCommandAsync(command);
        }
Beispiel #2
0
 /// <summary>
 /// Add or remove listing from favorites command handler async.
 /// </summary>
 /// <param name="listingCommand">Add or remove listing from favorites command.</param>
 public async Task HandleAddOrRemoveListingFromFavoritesCommandAsync(AddOrRemoveListingFromFavoritesCommand listingCommand)
 {
     await listingRepository.AddOrRemoveListingFromFavoritesAsync(listingCommand.UserId, listingCommand.ListingId, listingCommand.IsFavorite);
 }