Browse Source

use _eventRegistrationRepository.CountAsync instead.

pull/29/head
Halil İbrahim Kalkan 6 years ago
parent
commit
615a9eeb7f
  1. 6
      src/EventHub.Application/Events/Registrations/EventRegistrationAppService.cs
  2. 2
      src/EventHub.Application/Organizations/OrganizationAppService.cs

6
src/EventHub.Application/Events/Registrations/EventRegistrationAppService.cs

@ -83,11 +83,7 @@ namespace EventHub.Events.Registrations
public async Task<int> GetAttendeeCountAsync(Guid eventId)
{
var eventRegistrationQueryable = await _eventRegistrationRepository.GetQueryableAsync();
var query = eventRegistrationQueryable.Where(x => x.EventId == eventId);
return await AsyncExecuter.CountAsync(query);
return await _eventRegistrationRepository.CountAsync(x => x.EventId == eventId);
}
}
}

2
src/EventHub.Application/Organizations/OrganizationAppService.cs

@ -102,6 +102,7 @@ namespace EventHub.Organizations
if (organization.OwnerUserId != CurrentUser.GetId())
{
//TODO: throw AbpAuthorizationException instead
throw new BusinessException(EventHubErrorCodes.NotAuthorizedToUpdateOrganizationProfile)
.WithData("OrganizationName", organization.DisplayName);
}
@ -125,6 +126,7 @@ namespace EventHub.Organizations
if (organization.OwnerUserId != CurrentUser.GetId())
{
//TODO: throw AbpAuthorizationException instead
throw new BusinessException(EventHubErrorCodes.NotAuthorizedToUpdateOrganizationProfile)
.WithData("Name", organization.DisplayName);
}

Loading…
Cancel
Save