/// <summary> /// 创建一个联系人类型 /// </summary> /// <param name="contactType"></param> /// <returns></returns> public OperationResult CreateContactGroup(ContactGroup contactGroup) { OperationResult result = contactGroup.Validate(); contactGroup.CreateContactGroup(); if (!result.Success) { return(result); } var contactGroupPO = _mapper.Map <ContactGroupPO>(contactGroup); _contactGroupRepository.Add(contactGroupPO); result.Success = _contactGroupRepository.SaveChange() > 0; return(result); }