Exemple #1
0
        public RegistrationDto Rsvp(NewAcceptanceMessage message)
        {
            var name = new Name {First = message.FirstName, Last = message.LastName};
            var registration = new Registration
            {
                Id = Guid.Empty,
                Message = message.Message,
                Name = name,
                RespondedOn = DateTime.Now
            };

            _registrationRepository.Add(registration);

            return Mapper.Map<RegistrationDto>(registration);
        }
Exemple #2
0
        public RegistrationDto Rsvp(NewAcceptanceMessage message)
        {
            var name = new Name {First = message.FirstName, Last = message.LastName};
            var registration = new Registration
            {
                Message = message.Message,
                Name = name,
            };

            registration.Register();

            _registrationRepository.Add(registration);

            return Mapper.Map<RegistrationDto>(registration);
        }
        private Registration CreateRegistration()
        {
            var name = new Name
            {
                First = "John",
                Last = "Doe"
            };

            var registration = new Registration
            {
                Id = Guid.Empty,
                Name = name,
                Message = $"Thank you for hosting this event!"
            };

            return registration;
        }