Closed GoogleCodeExporter closed 9 years ago
Looks like this code should be using the ColumnEnum Attribute (sigh). Anyone
willing to create a patch for this :)? I can create a patch but it may take a
bit.
-Blake
Original comment by bniemyj...@codesmithtools.com
on 21 Apr 2011 at 12:12
Here is my attempt:
Index: DataAccessLayer/Query/SqlStringBuilder.cst
===================================================================
--- DataAccessLayer/Query/SqlStringBuilder.cst (revision 886)
+++ DataAccessLayer/Query/SqlStringBuilder.cst (working copy)
@@ -1840,7 +1840,7 @@
/// <returns></returns>
protected virtual String GetColumnName(EntityColumn column)
{
- String name = EntityHelper.GetEnumTextValue(column as Enum);
+ String name =
EntityHelper.GetAttribute<ColumnEnumAttribute>(column as Enum).Name;
if (string.IsNullOrEmpty(name))
{
@@ -2982,7 +2982,7 @@
/// <returns></returns>
protected virtual String GetColumnName(EntityColumn column)
{
- String name = EntityHelper.GetEnumTextValue(column as Enum);
+ String name =
EntityHelper.GetAttribute<ColumnEnumAttribute>(column as Enum).Name;
if (string.IsNullOrEmpty(name))
{
Index: DataAccessLayer/Utility.cst
===================================================================
--- DataAccessLayer/Utility.cst (revision 886)
+++ DataAccessLayer/Utility.cst (working copy)
@@ -285,7 +285,7 @@
try
{
col = (Enum) Enum.Parse(columnEnum, column, true);
- name = EntityHelper.GetEnumTextValue(col);
+ name = EntityHelper.GetAttribute<ColumnEnumAttribute>(col).Name;
if ( sb.Length > 0 )
{
@@ -312,9 +312,9 @@
if ( String.IsNullOrEmpty(sort) )
{
<%if(ProviderInvariantName == "MySql.Data.MySqlClient" || ProviderInvariantName == "System.Data.OracleClient"){%>
- sort = String.Format("'{0}'",
EntityHelper.GetEnumTextValue((Enum)Enum.Parse(columnEnum,
Enum.GetName(columnEnum, 1), true)));
+ sort = String.Format("'{0}'",
EntityHelper.GetAttribute<ColumnEnumAttribute>((Enum)Enum.Parse(columnEnum,
Enum.GetName(columnEnum, 1), true)).Name);
<%}else{%>
- sort = String.Format("[{0}]",
EntityHelper.GetEnumTextValue((Enum)Enum.Parse(columnEnum,
Enum.GetName(columnEnum, 1), true)));
+ sort = String.Format("[{0}]",
EntityHelper.GetAttribute<ColumnEnumAttribute>((Enum)Enum.Parse(columnEnum,
Enum.GetName(columnEnum, 1), true)).Name);
<%}%>
}
Original comment by vaibhavk...@gmail.com
on 21 Apr 2011 at 4:20
Attachments:
Any update guys?
Original comment by vaibhavk...@gmail.com
on 27 Apr 2011 at 10:37
Hello,
Thanks for your patch. I did a visual code review and the changes looked good
so I have committed the changes.
Thanks
-Blake Niemyjski
Original comment by bniemyjski
on 27 Apr 2011 at 4:47
Original issue reported on code.google.com by
vaibhavk...@gmail.com
on 20 Apr 2011 at 9:04