public async Task <IActionResult> ChangeContactInfo(Guid id, [FromBody] ChangeContactInfoModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await WorkerServices.ChangeContactInfoAsync(id, model); return(Ok()); }
public async Task ChangeContactInfoAsync(Guid companyId, ChangeContactInfoModel model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } var userId = GetCurrentUserId(); var cmd = new ChangeCompanyContactInfoCommand(userId, companyId, model.PhoneNumber, model.FaxNumber, model.WebsiteAddress, model.EmailAddress); await Bus.Send(cmd); }
public async Task ChangeContactInfoAsync(Guid personId, ChangeContactInfoModel model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } var userId = GetCurrentUserId(); var cmd = new ChangePersonContactInfoCommand( userId, personId, model.PhoneNumber, model.MobileNumber, model.FaxNumber, model.WebsiteAddress, model.EmailAddress, model.InstantMessaging); await Bus.Send(cmd); }