Esempio n. 1
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="columnIndex">
 ///   The input ordinal specificy which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T GetField <T>(this DataRow row, int columnIndex)
 {
     if (row == null)
     {
         throw new ArgumentNullException(nameof(row));
     }
     return(UnboxT <T> .Unbox(row[columnIndex]));
 }
Esempio n. 2
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="columnName">
 ///   The input column name specificy which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T GetField <T>(this DataRow row, string columnName)
 {
     if (row == null)
     {
         throw new ArgumentNullException(nameof(row));
     }
     if (columnName.IsNullOrEmpty())
     {
         throw new ArgumentNullException(nameof(columnName));
     }
     return(UnboxT <T> .Unbox(row[columnName]));
 }
Esempio n. 3
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="column">
 ///   The input DataColumn specificy which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T GetField <T>(this DataRow row, DataColumn column)
 {
     if (row == null)
     {
         throw new ArgumentNullException(nameof(row));
     }
     if (column == null)
     {
         throw new ArgumentNullException(nameof(column));
     }
     return(UnboxT <T> .Unbox(row[column]));
 }
Esempio n. 4
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="columnIndex">
 ///   The input ordinal specificy which row value to retrieve.
 /// </param>
 /// <param name="version">
 ///   The DataRow version for which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T Field <T>(this DataRow row, int columnIndex, DataRowVersion version)
 {
     DataSetUtil.CheckArgumentNull(row, "row");
     return(UnboxT <T> .Unbox(row[columnIndex, version]));
 }
Esempio n. 5
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="column">
 ///   The input DataColumn specificy which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T Field <T>(this DataRow row, DataColumn column)
 {
     DataSetUtil.CheckArgumentNull(row, "row");
     return(UnboxT <T> .Unbox(row[column]));
 }
Esempio n. 6
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="columnName">
 ///   The input column name specificy which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T Field <T>(this DataRow row, string columnName)
 {
     DataSetUtil.CheckArgumentNull(row, "row");
     return(UnboxT <T> .Unbox(row[columnName]));
 }
Esempio n. 7
0
 public static T Field <T>(this SettingsModel settings, string fieldName)
 {
     return(UnboxT <T> .Unbox(settings[fieldName]));
 }
Esempio n. 8
0
 public static T Field <T>(this DataRow row, DataColumn column, DataRowVersion version)
 {
     Guard.CheckArgumentNull(row, "row");
     return(UnboxT <T> .Unbox(row[column, version]));
 }
Esempio n. 9
0
 public static T Field <T>(this DataRow row, int columnIndex)
 {
     return(UnboxT <T> .Unbox(row[columnIndex]));
 }
Esempio n. 10
0
 public static T Field <T>(this DataRow row, int columnIndex)
 {
     Guard.CheckArgumentNull(row, "row");
     return(UnboxT <T> .Unbox(row[columnIndex]));
 }
Esempio n. 11
0
 public static T Field <T>(this DataRow row, string columnName)
 {
     return(UnboxT <T> .Unbox(row[columnName]));
 }
Esempio n. 12
0
 public static T Field <T>(this DataRow row, DataColumn column, DataRowVersion version)
 {
     return(UnboxT <T> .Unbox(row[column, version]));
 }
Esempio n. 13
0
 public static T Field <T>(this DataRow row, string columnName, DataRowVersion version)
 {
     return(UnboxT <T> .Unbox(row[columnName, version]));
 }
Esempio n. 14
0
 public static T Field <T>(this DataRow row, int columnIndex, DataRowVersion version)
 {
     return(UnboxT <T> .Unbox(row[columnIndex, version]));
 }