/// <summary> /// Creates a new instance of FluentIgnorePropertyValue<TSource> based on a previous instance and adds to it a property name to be ignored. /// </summary> /// <param name="fluentIgnoredPropertyValue">Previous instance of FluentIgnorePropertyValue<TSource></param> /// <param name="propertyName">Property name to be added</param> public FluentIgnorePropertyValue(FluentIgnorePropertyValue <TSource> fluentIgnoredPropertyValue, string propertyName) { ClassInstance = fluentIgnoredPropertyValue.ClassInstance; PropertiesList = new List <string>(); PropertiesList.AddRange(fluentIgnoredPropertyValue.PropertiesList); PropertiesList.Add(propertyName); }
/// <summary> /// Adds a property to be ignored in the stringifier. /// </summary> public static FluentIgnorePropertyValue <TSource> AndExceptThisProperty <TSource, TProperty>(this FluentIgnorePropertyValue <TSource> fluentPropertuValue, Expression <Func <TSource, TProperty> > propertyLambda) { string propertyName = GetName(propertyLambda); return(new FluentIgnorePropertyValue <TSource>(fluentPropertuValue, propertyName)); }