Class BaseExtensions
Extension methods.
public static class BaseExtensions
- Inheritance
-
objectBaseExtensions
Methods
AsDataContainer(DataRow)
Converts a DataRow to IDataContainer. Returns null if the original data row is null.
public static IDataContainer AsDataContainer(this DataRow dr)
Parameters
drDataRowData row
Returns
Batch<T>(IEnumerable<T>, int)
Returns input in batches of batchSize size.
public static IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> collection, int batchSize)
Parameters
collectionIEnumerable<T>Collection to be batched
batchSizeintSize of each chunk (except for the last one)
Returns
- IEnumerable<IEnumerable<T>>
Type Parameters
T
Replace(Regex, string, string, bool)
Replaces a re
public static string Replace(this Regex regEx, string input, string replacement, bool allowSubstitutions)
Parameters
regExRegexRegular expression
inputstringInput text to replace
replacementstringReplacement string
allowSubstitutionsboolIf set to false, substitutions are not allowed within the replacement string
Returns
- string