Skip to content

Commit

Permalink
Changed CurrentCultuerIgnoreCase to OrdinalIgnoreCase - thanks justinvp!
Browse files Browse the repository at this point in the history
  • Loading branch information
robconery committed Aug 31, 2011
1 parent 63c546c commit 5ad17a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Massive.cs
Expand Up @@ -341,7 +341,7 @@ public class DynamicModel : DynamicObject {
int counter = 0;
foreach (var item in settings) {
var val = item.Value;
if (!item.Key.Equals(PrimaryKeyField, StringComparison.CurrentCultureIgnoreCase) && item.Value != null) {
if (!item.Key.Equals(PrimaryKeyField, StringComparison.OrdinalIgnoreCase) && item.Value != null) {
result.AddParam(val);
sbKeys.AppendFormat("{0} = @{1}, \r\n", item.Key, counter.ToString());
counter++;
Expand All @@ -365,7 +365,7 @@ public class DynamicModel : DynamicObject {
sql += string.Format("WHERE {0}=@0", PrimaryKeyField);
args = new object[] { key };
} else if (!string.IsNullOrEmpty(where)) {
sql += where.Trim().StartsWith("where", StringComparison.CurrentCultureIgnoreCase) ? where : "WHERE " + where;
sql += where.Trim().StartsWith("where", StringComparison.OrdinalIgnoreCase) ? where : "WHERE " + where;
}
return CreateCommand(sql, null, args);
}
Expand Down Expand Up @@ -408,9 +408,9 @@ public class DynamicModel : DynamicObject {
private static string BuildSelect(string where, string orderBy, int limit) {
string sql = limit > 0 ? "SELECT TOP " + limit + " {0} FROM {1} " : "SELECT {0} FROM {1} ";
if (!string.IsNullOrEmpty(where))
sql += where.Trim().StartsWith("where", StringComparison.CurrentCultureIgnoreCase) ? where : "WHERE " + where;
sql += where.Trim().StartsWith("where", StringComparison.OrdinalIgnoreCase) ? where : "WHERE " + where;
if (!String.IsNullOrEmpty(orderBy))
sql += orderBy.Trim().StartsWith("order by", StringComparison.CurrentCultureIgnoreCase) ? orderBy : " ORDER BY " + orderBy;
sql += orderBy.Trim().StartsWith("order by", StringComparison.OrdinalIgnoreCase) ? orderBy : " ORDER BY " + orderBy;
return sql;
}
/// <summary>
Expand All @@ -431,7 +431,7 @@ public class DynamicModel : DynamicObject {
orderBy = PrimaryKeyField;

if (!string.IsNullOrEmpty(where)) {
if (!where.Trim().StartsWith("where", StringComparison.CurrentCultureIgnoreCase)) {
if (!where.Trim().StartsWith("where", StringComparison.OrdinalIgnoreCase)) {
where = "WHERE " + where;
}
}
Expand Down

0 comments on commit 5ad17a5

Please sign in to comment.