コード例 #1
0
        private async Task ValidateVenue(Venue venue)
        {
            if (string.IsNullOrWhiteSpace(venue.Name))
            {
                throw new OdkServiceException("Name required");
            }

            Venue existing = await _venueRepository.GetVenueByName(venue.Name);

            if (existing != null && existing.Id != venue.Id)
            {
                throw new OdkServiceException("Venue with that name already exists");
            }
        }