You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
481 B
22 lines
481 B
using Newtonsoft.Json;
|
|
|
|
namespace RSND.Core.Querying.Queries;
|
|
|
|
public static class QueryHelper
|
|
{
|
|
public static QueryType? GetQueryType(string queryJson)
|
|
{
|
|
BaseQuery? query = JsonConvert.DeserializeObject<BaseQuery>(queryJson);
|
|
|
|
if (query != null)
|
|
{
|
|
return query.Type switch
|
|
{
|
|
"GetValue" => QueryType.GetValue,
|
|
_ => null
|
|
};
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|