Skip to content

Commit

Permalink
Change AutoQuery to use shared string.ChangeTo(Type) ext method
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed May 23, 2016
1 parent 19f3371 commit e6c454f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
Binary file modified lib/ServiceStack.Text.dll
Binary file not shown.
4 changes: 1 addition & 3 deletions src/ServiceStack.Server/AutoQueryFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,7 @@ private static void AppendUntypedQueries(SqlExpression<From> q, Dictionary<strin
TypeSerializer.DeserializeFromString(strValue, Array.CreateInstance(fieldType, 0).GetType())
: fieldType == typeof(string) ?
strValue
: fieldType.IsValueType && !fieldType.IsEnum ?
Convert.ChangeType(strValue, fieldType) :
TypeSerializer.DeserializeFromString(strValue, fieldType);
: strValue.ChangeTo(fieldType);

AddCondition(q, defaultTerm, quotedColumn, value, implicitQuery);
}
Expand Down
4 changes: 1 addition & 3 deletions src/ServiceStack/AutoQueryDataFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,9 +1241,7 @@ private static void AppendUntypedQueries(IDataQuery q, Dictionary<string, string
TypeSerializer.DeserializeFromString(strValue, Array.CreateInstance(fieldType, 0).GetType())
: fieldType == typeof(string) ?
strValue
: fieldType.IsValueType && !fieldType.IsEnum ?
Convert.ChangeType(strValue, fieldType) :
TypeSerializer.DeserializeFromString(strValue, fieldType);
: strValue.ChangeTo(fieldType);

AddCondition(q, defaultTerm, match.FieldDef, value, condition);
}
Expand Down

0 comments on commit e6c454f

Please sign in to comment.