Beispiel #1
0
        public async Task <Venue> CreateVenue(Guid currentMemberId, CreateVenue venue)
        {
            await AssertMemberIsChapterAdmin(currentMemberId, venue.ChapterId);

            Venue create = new Venue(Guid.Empty, venue.ChapterId, venue.Name, venue.Address, venue.MapQuery, 0);

            await ValidateVenue(create);

            Guid id = await _venueRepository.CreateVenue(create);

            _cacheService.RemoveVersionedCollection <Venue>(venue.ChapterId);

            return(await _venueRepository.GetVenue(id));
        }
Beispiel #2
0
        public async Task <Venue> UpdateVenue(Guid memberId, Guid id, CreateVenue venue)
        {
            Venue update = await GetVenue(memberId, id);

            update.Update(venue.Name, venue.Address, venue.MapQuery);

            await ValidateVenue(update);

            await _venueRepository.UpdateVenue(update);

            _cacheService.RemoveVersionedItem <Venue>(id);
            _cacheService.RemoveVersionedCollection <Venue>(update.ChapterId);

            return(update);
        }