Пример #1
0
 public async Task PublishCreateFundraiser(FundraiserDto fundraiser)
 {
     if (fundraiser == null)
     {
         throw new ArgumentNullException(nameof(fundraiser));
     }
     var connectionId = Context.ConnectionId;
     await Clients.AllExcept(connectionId).SendAsync("ReceiveNewFundraiser", fundraiser);
 }
Пример #2
0
        public async Task <IViewComponentResult> InvokeAsync(FundraiserDto fundraiser)
        {
            var donations = await donationService.GetDonationsByFundAsync(fundraiser.Id);

            if (donations == null)
            {
                throw new ArgumentNullException(nameof(donations));
            }
            var vm = new FundTotalSummaryViewModel
            {
                Fundraiser = fundraiser,
                Donations  = mapper.Map <IEnumerable <DonationDto> >(donations)
            };

            return(View(vm));
        }