public IActionResult PostPhoneForAssociate(int contactId, [FromBody] Commands.V1.Associate.Phone.Create request) { Commands.V1.Associate.Phone.CreateForAssociate createForAssociate = new Commands.V1.Associate.Phone.CreateForAssociate(contactId, request); return(CreatedAtAction("PostPhoneForAssociate", (PhoneRM)_appService.Handle(createForAssociate).Result)); }
private static PhoneRM AddPrimaryPhoneForAssociate(AssociateRM associateRM, PhoneTypeLookup.PhoneTypeEnum phoneType, long phoneNumber) { Console.WriteLine("EFTEST: Setting up primary phone for Associate " + associateRM.LongName); Commands.V1.Associate.Phone.CreateForAssociate createPhoneCommand = new Commands.V1.Associate.Phone.CreateForAssociate { AssociateId = associateRM.Id, IsPrimary = true, Extension = null, PhoneTypeId = (int)phoneType, PhoneNumber = phoneNumber }; if (_technologyType != 1) { throw new InvalidOperationException("AddPrimaryPhoneForAssociate not supported for REST"); } return((PhoneRM)_appService.Handle(createPhoneCommand).Result); }