Beispiel #1
0
        public async Task <IActionResult> AssociateMainContact([FromBody] AssociateCompanyMainContactModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await WorkerServices.AssociateCompanyMainContact(model);

            return(Ok());
        }
Beispiel #2
0
        public async Task AssociateCompanyMainContact(AssociateCompanyMainContactModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            var cmd = new AssociateMainContactToCompanyCommand(
                model.UserId,
                model.CompanyId,
                model.MainContactId
                );

            await Bus.Send(cmd);
        }