Skip to content

Commit

Permalink
feat: optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
AElfBourneShi committed Oct 21, 2024
1 parent 47a3326 commit f582f0c
Showing 1 changed file with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,52 +335,27 @@ private Node GetDifferentTypesTermsQueryNode()
{
query = GetTermsNode<Guid>();
}
else if (PropertyType == typeof(Guid?))
{
query = GetTermsNode<Guid?>();
}
else if (PropertyType == typeof(int))
{
query = GetTermsNode<int>();
}
else if (PropertyType == typeof(int?))
{
query = GetTermsNode<int?>();
}
else if (PropertyType == typeof(long))
{
query = GetTermsNode<long>();
}
else if (PropertyType == typeof(long?))
{
query = GetTermsNode<long?>();
}
else if (PropertyType == typeof(double))
{
query = GetTermsNode<double>();
}
else if (PropertyType == typeof(double?))
{
query = GetTermsNode<double?>();
}
else if (PropertyType == typeof(bool))
{
query = GetTermsNode<bool>();
}
else if (PropertyType == typeof(bool?))
{
query = GetTermsNode<bool?>();
}
else if (PropertyType == typeof(DateTime))
{
query = new TermsNode(PropertyName,
((IEnumerable<DateTime>)Value).Select(x => x.ToString("o")));
}
else if (PropertyType == typeof(DateTime?))
{
query = new TermsNode(PropertyName,
((IEnumerable<DateTime>)Value).Select(x => x.ToString("o")));
}
else if (PropertyType == typeof(string))
{
query = new TermsNode(PropertyName, (IEnumerable<string>)Value);
Expand Down

0 comments on commit f582f0c

Please sign in to comment.