/// <summary> /// Gets contract name for the provided <see cref="IExportConvention"/>. /// </summary> /// <param name="exportConvention">The <see cref="IExportConvention"/> that the contract name should be retreived for.</param> /// <param name="member">The <see cref="MemberInfo"/> that is being exported.</param> /// <returns>A <see cref="string"/> containing the contract name for the export.</returns> /// <exception cref="ArgumentNullException">The value of the <paramref name="member"/> or <paramref name="exportConvention"/> parameter was <see langword="null"/>.</exception> public virtual string GetExportContractName(IExportConvention exportConvention, MemberInfo member) { if (exportConvention == null) { throw new ArgumentNullException("exportConvention", "The export convention cannot be null."); } if (member == null) { throw new ArgumentNullException("member", "The member cannot be null."); } return(ContractServices.GetExportContractName( (exportConvention.ContractName == null) ? null : exportConvention.ContractName.Invoke(member), (exportConvention.ContractType == null) ? null : exportConvention.ContractType.Invoke(member), member)); }