public async Task<ActionResult<RegistrationResult>> CreateRegistrantProfile(RegistrantProfile registrant)
        {
            if (registrant == null) return BadRequest();

            var profile = mapper.Map<ESS.Shared.Contracts.Submissions.RegistrantProfile>(registrant);
            var id = await messagingClient.Send(new SaveRegistrantCommand
            {
                Profile = profile
            });
            return Ok(new RegistrationResult { Id = id });
        }
Esempio n. 2
0
        public async Task <ActionResult <RegistrationResult> > UpdateRegistrantProfile(string registrantId, RegistrantProfile registrant)
        {
            if (registrant == null)
            {
                return(BadRequest());
            }

            registrant.Id = registrantId;

            var profile = mapper.Map <ESS.Shared.Contracts.Events.RegistrantProfile>(registrant);
            var id      = await messagingClient.Send(new SaveRegistrantCommand
            {
                Profile = profile
            });

            return(Ok(new RegistrationResult {
                Id = id
            }));
        }