Esempio n. 1
0
 /// <summary>
 /// For Csv file generation grammars, mark this cell as being included in the CSV file
 /// generation with a default value if the column is not explicitly included in the specification
 /// </summary>
 /// <param name="expression"></param>
 /// <param name="defaultValue"></param>
 /// <returns></returns>
 public static ICellExpression UseDefaultIfNotExplicitlyExpressed(this ICellExpression expression,
                                                                  string defaultValue)
 {
     expression.Metadata(CsvRequiredKey, CsvRequired.UseDefaultIfNotExplicitlyExpressed);
     return(expression.DefaultValue(defaultValue));
 }
Esempio n. 2
0
 /// <summary>
 /// For Csv file generation grammars, mark this cell as being included in the CSV file
 /// generation with a default value if the column is not explicitly included in the specification
 /// </summary>
 /// <param name="expression"></param>
 /// <param name="defaultValueSource">A lambda to build default data per row</param>
 /// <returns></returns>
 public static ICellExpression UseDefaultIfNotExplicitlyExpressed(this ICellExpression expression, Func <StepValues, string> defaultValueSource)
 {
     expression.DefaultValue("NULL");
     expression.Metadata(CsvRequiredKey, CsvRequired.UseDefaultIfNotExplicitlyExpressed);
     return(expression.Metadata(CsvValueBuilderKey, defaultValueSource));
 }
Esempio n. 3
0
 /// <summary>
 /// For Csv file generation grammars, mark this cell as being completely omitted
 /// from the generated file if the column is not explicitly included in the specification
 /// </summary>
 /// <param name="expression"></param>
 /// <returns></returns>
 public static ICellExpression OmitIfInactive(this ICellExpression expression)
 {
     expression.DefaultValue("NULL");
     return(expression.Metadata(CsvRequiredKey, CsvRequired.OmitIfInactive));
 }