/// <summary> /// Include specified method to resulting typing. /// User <see cref="Ts.Parameter{T}()" /> to mock up method parameters or specify configuration for perticular method /// parameter /// </summary> /// <param name="tc">Configuration builder</param> /// <param name="method">Method to include</param> /// <param name="configuration">Configuration to be applied to method</param> /// <returns>Fluent</returns> public static ClassConfigurationBuilder <T> WithMethod <T>(this ClassConfigurationBuilder <T> tc, Expression <Action <T> > method, Action <MethodExportConfiguration> configuration) { tc.WithMethods(new[] { LambdaHelpers.ParseMethodLambda(method) }, configuration); ITypeConfigurationBuilder tcb = tc; ExtractParameters(tcb, method); return(tc); }
/// <summary> /// Include specified property to resulting typing /// </summary> /// <param name="tc">Configuration builder</param> /// <param name="property">Property to include</param> /// <param name="configuration">Configuration to be applied to selected property</param> /// <returns>Fluent</returns> public static ClassConfigurationBuilder <T> WithField <T, TData>(this ClassConfigurationBuilder <T> tc, Expression <Func <T, TData> > property, Action <PropertyExportConfigurationBuilder> configuration) { return(tc.WithFields(new[] { LambdaHelpers.ParseFieldLambda(property) }, configuration)); }