Ejemplo n.º 1
0
        /// <summary>
        /// Gets type identity for the provided <see cref="IImportConvention"/>.
        /// </summary>
        /// <param name="importConvention">The <see cref="IImportConvention"/> that the type identity should be retreived for.</param>
        /// <param name="member">The <see cref="MemberInfo"/> that is being imported.</param>
        /// <returns>A <see cref="string"/> containing the type identity for the imported.</returns>
        /// <exception cref="ArgumentNullException">The value of the <paramref name="member"/> or <paramref name="importConvention"/> parameter was <see langword="null"/>.</exception>
        public virtual string GetImportTypeIdentity(IImportConvention importConvention, MemberInfo member)
        {
            if (importConvention == null)
            {
                throw new ArgumentNullException("importConvention", "The import convention cannot be null.");
            }

            if (member == null)
            {
                throw new ArgumentNullException("member", "The member cannot be null.");
            }

            return(ContractServices.GetImportTypeIdentity(
                       (importConvention.ContractType == null) ? null : importConvention.ContractType.Invoke(member),
                       member));
        }