Convert SQL Server Table-Valued parameter to C# data access wrapper

136 Views Asked by At

Using Codesmith 7, I'm trying to generate a C# data access wrapper. The table-valued parameters only show up as object in DataType and SystemType.

It boils down to two issues:

  1. Is there a way of accessing the user defined table type through Codesmith? (so that I can generate a C# datatable with columns prefilled)

  2. Is there a way of ascertaining that the parameter is a user defined table type, and so I can set the public/private properties to DataTable instead of object?

1

There are 1 best solutions below

0
Blake Niemyjski On

I work for CodeSmith....

  1. Yes, this should be available. You can access this via the ExtendedProperties object (https://codesmith.atlassian.net/wiki/display/Generator/Using+Extended+Properties). If you take a look, we will put all the information available in the extended properties around custom types.
  2. Yes, via extended properties.