What steps will reproduce the problem?
1. Create a table with a nullable column of a type that ends up as a .net
value type. My column was a float.
2. Generate the templates.
3. Examine the BulkInsert method. The DataSet column for the nullable
column will be added as a Nullable<T> which is invalid and causes a runtime
error.
What is the expected output? What do you see instead?
I expect a normal Double to appear in the code. Not a "Double?"
What version of .netTiers and CodeSmith are you using?
CodeSmith 5.x. netTiers 2.3.805
Please provide any additional information below.
In DataAccessLayer.SqlClient\SqlEntityProviderBase.generated.cst
Line 975: GetCSType(cols[i], false) is called. Notice the false. This
presumably indicates to GetCSType that a nullable type is not wanted.
In CommonSqlCode:
Line 3544: Calls GetAliasName(col.Table.Owner, col.Table.Name, col.Name,
ReturnFields.CSType)
GetAliasName merely returns whatever is in the mapping file if a mapping
file is being used. This is not good. The mapping file *must* have the
proper, nullable type, but when GetCSType is called with false for
nullable, GetAliasName has no way of knowing that, and the choice is not
respected.
I added a hack to replace the "?" with "" if nullable is false.
Why is GetAliasName called "GetAliasName" when it does way more than get
table alias names? It should be renamed.
Original issue reported on code.google.com by codemonk...@gmail.com on 23 Apr 2009 at 7:11
Original issue reported on code.google.com by
codemonk...@gmail.com
on 23 Apr 2009 at 7:11