Browse Source

Code simplified.

pull/662/head
Sebastian 5 years ago
parent
commit
1561d54832
  1. 16
      backend/src/Squidex.Infrastructure/Queries/OData/ConstantWithTypeVisitor.cs

16
backend/src/Squidex.Infrastructure/Queries/OData/ConstantWithTypeVisitor.cs

@ -47,6 +47,11 @@ namespace Squidex.Infrastructure.Queries.OData
return ClrValue.Null;
}
if (nodeIn.TypeReference == null)
{
throw new NotSupportedException();
}
if (nodeIn.TypeReference.Definition == BooleanType)
{
return bool.Parse(value.ToString()!);
@ -62,11 +67,6 @@ namespace Squidex.Infrastructure.Queries.OData
return ParseInstant(value);
}
if (ConstantVisitor.Visit(nodeIn.Source) == null)
{
return ClrValue.Null;
}
throw new NotSupportedException();
}
@ -122,8 +122,11 @@ namespace Squidex.Infrastructure.Queries.OData
return ClrValue.Null;
}
if (nodeIn.TypeReference != null)
if (nodeIn.TypeReference == null)
{
throw new NotSupportedException();
}
if (nodeIn.TypeReference.Definition == DateTimeType || nodeIn.TypeReference.Definition == DateType)
{
return ParseInstant(nodeIn.Value);
@ -163,7 +166,6 @@ namespace Squidex.Infrastructure.Queries.OData
{
return (string)nodeIn.Value;
}
}
throw new NotSupportedException();
}

Loading…
Cancel
Save