Пример #1
0
        public async Task <IActionResult> SetContactInfo([FromBody] SetCompanyContactInfoModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await WorkerServices.SetCompanyContactInfoAsync(model);

            return(Ok());
        }
Пример #2
0
        public async Task SetCompanyContactInfoAsync(SetCompanyContactInfoModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            var userId = model.UserId;

            var cmd = new ChangeCompanyContactInfoCommand(
                userId,
                model.CompanyId,
                model.PhoneNumber,
                model.FaxNumber,
                model.WebsiteAddress,
                model.EmailAddress);

            await Bus.Send(cmd);
        }