VistaDB Support Center

Start a new topic
Planned

Overload DDA put methods to accept nullable values

Have you guys thought about overloading the DDA put methods to accept nullable values? Here are the extensions method I use for int?: 

 

public static void PutInt32(this IVistaDBTable tbl, int index, int? value)
{
    if (value.HasValue) tbl.PutInt32(index, value.Value);
    else tbl.PutNull(index);
}

public static void PutInt32(this IVistaDBTable tbl, string columnName, int? value)
{
    if (value.HasValue) tbl.PutInt32(columnName, value.Value); else tbl.PutNull(columnName);
} 
  
I'm attaching a file containing the rest of the overloaded put extension methods. They've saved me quite a bit of typing :) Thanks, Chris

1 person likes this idea
1 Comment

That's a great point, I wonder how this got missed way back when the VistaDB API was being made.  We'll look to incorporate this in our next API change release.

Login to post a comment