RSND/RSND/Core/Querying/QueryHelper.cs

22 lines
481 B
C#
Raw Normal View History

2022-06-01 22:24:42 +00:00
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;
}
}