Exemple #1
0
        public async Task CreateAsync(Guid id, string title, string description, string category, DateTime date, string city, string venue)
        {
            var activity = await _activityRepository.GetByIdAsync(id);

            if (activity != null)
            {
                throw new InfrastructureException(HttpStatusCode.Conflict, ErrorMessage.ActivityAlreadyExists);
            }

            activity = Activity.Create(id, title, description, category, date, city, venue);

            await _activityRepository.AddSingleAsync(activity);
        }