22 lines
481 B
C#
22 lines
481 B
C#
|
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;
|
|||
|
}
|
|||
|
}
|