コード例 #1
0
        /// <summary>
        /// Registers a type to skip when generating values.
        /// </summary>
        /// <typeparam name="TType">The type to skip.</typeparam>
        /// <param name="builder">The current configuration builder instance.</param>
        /// <returns>The current configuration builder instance.</returns>
        public static IAutoFakerDefaultConfigBuilder WithSkip <TType>(this IAutoFakerDefaultConfigBuilder builder)
        {
            var type = typeof(TType);

            return(builder?.WithSkip(type));
        }
コード例 #2
0
        /// <summary>
        /// Registers a member to skip for a given type when generating values.
        /// </summary>
        /// <typeparam name="TType">The parent type containing the member.</typeparam>
        /// <param name="builder">The current configuration builder instance.</param>
        /// <param name="member">The member to skip.</param>
        /// <returns>The current configuration builder instance.</returns>
        public static IAutoFakerDefaultConfigBuilder WithSkip <TType>(this IAutoFakerDefaultConfigBuilder builder, Expression <Func <TType, object> > member)
        {
            var memberName = GetMemberName(member);

            return(builder?.WithSkip <TType>(memberName));
        }