NullableTypes/src/Types DbNullConvert.cs,1.4,1.5
Status: Inactive
Brought to you by:
lukadotnet
From: Damien G. <dam...@us...> - 2005-09-23 09:47:30
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Types In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31041/src/Types Modified Files: DbNullConvert.cs Log Message: Implement DBNullConvert.From for NullableGuid and add a unit test for it as per issue 1265825. Index: DbNullConvert.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Types/DbNullConvert.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DbNullConvert.cs 12 Feb 2005 03:44:34 -0000 1.4 --- DbNullConvert.cs 23 Sep 2005 09:47:22 -0000 1.5 *************** *** 15,18 **** --- 15,19 ---- // 06-Oct-2003 Luca Upgrade Code upgrade: Replaced tabs with spaces // 28-Jan-2005 DamienG Upgrade Added support for NullableGuid and added regions. + // 05-Sep-2005 DamienG Upgrade Added // *************** *** 645,648 **** --- 646,672 ---- /// </summary> /// <param name="x"> + /// A <see cref="NullableGuid"/> value. + /// </param> + /// <returns> + /// <see cref="System.DBNull"/> if <paramref name="x"/> is + /// <see cref="NullableGuid.Null"/> otherwise + /// the <see cref="NullableGuid.Value"/> of <paramref name="x"/>. + /// </returns> + public static object From(NullableGuid x) + { + if (x.IsNull) + return sys.DBNull.Value; + + return x.Value; + } + + /// <summary> + /// Converts the specified value to an + /// equivalent <see cref="System.Object"/> value that can be assigned to + /// a <see cref="System.Data.DataRow"/> Item value, a + /// <see cref="System.Data.IDbCommand.Parameters"/> Item value or a + /// <see cref="System.Data.IDataRecord"/> Item value. + /// </summary> + /// <param name="x"> /// A <see cref="NullableString"/> value. /// </param> |