Quantcast
Channel: EntityFramework Reverse POCO Code First Generator
Viewing all articles
Browse latest Browse all 1642

Edited Issue: Stored procedure return column name tidy up could bring all Null value [107]

$
0
0
EF.Reverse.POCO.Generator has a code snippet to tide up stored procedure's return column name, here is code:

proc.ReturnColumns = ds.Tables[0].Columns.Cast<DataColumn>().ToList();
// Tidy up
foreach (var col in proc.ReturnColumns)
{
col.ColumnName = Regex.Replace(col.ColumnName, @"[^A-Za-z0-9\s]*", "");
col.ColumnName = Inflector.ToTitleCase(col.ColumnName).Replace(" ", "");
}

This could bring an issues that C# code cannot get correct stored procedure query result when column name has underline(s), e.g. if column name is "student_score", after tidy up, in return model class, corresponding property name is "StudentScore", in the list of query result, this property StudentScore is always NULL.

Viewing all articles
Browse latest Browse all 1642

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>