Class Extensions
- Namespace
- YndigoBlue.Velocity.Utils
- Assembly
- YndigoBlue.Velocity.dll
Provides extension methods for common data manipulation and conversion operations.
public static class Extensions
- Inheritance
-
Extensions
Remarks
Extensions offers utility methods for working with DataTables, date/time types, geospatial data, and string collections. These methods enhance the functionality of standard .NET types and simplify common operations when working with Velocity's data access and result processing features.
Methods
- Contents(DataTable)
Generates a formatted string representation of the DataTable's contents.
- ConvertColumnType(DataTable, string, Type, Type)
Converts a DataTable column from one type to another, preserving data where possible.
- GetFeature(Result, string, bool)
Converts a Result row to a GeoJSON Feature with geometry and attributes.
- GetPrecision(decimal)
Gets the precision (total number of significant digits) of a decimal value.
- GetScale(decimal)
Gets the scale (number of decimal places) of a decimal value.
- LoadFromReader(DataTable, DbDataReader)
Loads data from a DbDataReader into a DataTable with automatic type detection.
- Split(DataTable, int)
Splits a DataTable into multiple smaller DataTables of the specified size.
- Subset(DataTable, string)
Creates a subset of the DataTable containing only rows matching the filter.
- Subset(DataTable, string, params string[])
Creates a subset of the DataTable containing only rows matching the filter and specified columns.
- Subset(DataTable, params string[])
Creates a subset of the DataTable containing only the specified columns.
- ToCommaSeparated(IEnumerable<string>)
Joins an enumerable of strings into a comma-separated string.
- ToCommaSeparated(List<string>)
Joins a list of strings into a comma-separated string.
- ToDateOnly(DateTime)
Converts a DateTime to DateOnly, discarding the time component.
- ToDateTime(DateOnly)
Converts a DateOnly value to DateTime with time set to midnight.
- ToGeography(Geometry)
Converts a planar Geometry to a spherical Geography for Earth-surface calculations.
- ToNewLineSeparated(IEnumerable<string>)
Joins an enumerable of strings with newline separators.
- ToSeparated(IEnumerable<string>, string)
Joins an enumerable of strings with a custom separator.
- ToSeparated(List<string>, string)
Joins a list of strings with a custom separator.
- ToSpaceSeparated(IEnumerable<string>)
Joins an enumerable of strings into a space-separated string.
- ToSpaceSeparated(List<string>)
Joins a list of strings into a space-separated string.
- ToTimestamp(DateTime)
Converts a DateTime to DateTimeOffset with UTC offset of zero.
- Today(DateOnly)
Gets today's date as a DateOnly value.
- TrimMilliseconds(DateTime)
Removes milliseconds from a DateTime value.
- TrimMilliseconds(DateTimeOffset)
Removes milliseconds from a DateTimeOffset value.