Ejemplo n.º 1
0
        public async Task <IActionResult> SetContactInfo([FromBody] SetPersonContactInfoModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await WorkerServices.SetPersonContactInfoAsync(model);

            return(Ok());
        }
Ejemplo n.º 2
0
        public async Task SetPersonContactInfoAsync(SetPersonContactInfoModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            var userId = model.UserId;

            var cmd = new ChangePersonContactInfoCommand(
                userId,
                model.PersonId,
                model.PhoneNumber,
                model.MobileNumber,
                model.FaxNumber,
                model.WebsiteAddress,
                model.EmailAddress,
                model.InstantMessaging);

            await Bus.Send(cmd);
        }