Exemplo n.º 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 IAutoFakerConfigBuilder WithSkip <TType>(this IAutoFakerConfigBuilder builder)
        {
            var type = typeof(TType);

            return(builder?.WithSkip(type));
        }
Exemplo n.º 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 IAutoFakerConfigBuilder WithSkip <TType>(this IAutoFakerConfigBuilder builder, Expression <Func <TType, object> > member)
        {
            var memberName = GetMemberName(member);

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