private PhoneRM CreatePhoneForContact(Commands.V1.Contact.Phone.CreateForContact cmd) { Phone phone = Phone.CreateForContact(_phones++, cmd.IsPrimary, cmd.ContactId, Extension.Create(cmd.Extension), PhoneTypeLookup.PhoneTypes[cmd.PhoneTypeId]); if (_repository.PhoneExistsForContact(phone, cmd.ContactId)) { throw new InvalidOperationException($"Phone already exists for Contact {cmd.ContactId}"); } _repository.AddPhoneForContact(phone, cmd.ContactId); return(Conversions.GetPhoneRM(phone)); }