Skip to content

Commit

Permalink
added converter for xmla filter rule
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlagunas committed Jun 7, 2024
1 parent 245a7a1 commit f365b5e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Reveal.Sdk.Dom.Visualizations;
using Reveal.Sdk.Dom.Core.Constants;
using Reveal.Sdk.Dom.Visualizations;
using System;
using System.Collections.Generic;

Expand All @@ -10,10 +11,10 @@ public XmlaDimensionElementConverter()
{
TypeMap = new Dictionary<string, Type>()
{
{ "XmlaDimensionType", typeof(XmlaDimension) },
{ "XmlaHierarchyLevelType", typeof(XmlaHierarchyLevel) },
{ "XmlaHierarchyType", typeof(XmlaHierarchy) },
{ "XmlaSetType", typeof(XmlaSet) },
{ SchemaTypeNames.XmlaDimensionType, typeof(XmlaDimension) },
{ SchemaTypeNames.XmlaHierarchyLevelType, typeof(XmlaHierarchyLevel) },
{ SchemaTypeNames.XmlaHierarchyType, typeof(XmlaHierarchy) },
{ SchemaTypeNames.XmlaSetType, typeof(XmlaSet) },
};
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Reveal.Sdk.Dom.Core.Constants;
using Reveal.Sdk.Dom.Filters;
using System;
using System.Collections.Generic;

namespace Reveal.Sdk.Dom.Core.Serialization.Converters
{
internal class XmlaFilterRuleConverter : TypeMapConverter<XmlaFilterRule>
{
public XmlaFilterRuleConverter()
{
TypeMap = new Dictionary<string, Type>()
{
{ SchemaTypeNames.XmlaNumberFilterRuleType, typeof(XmlaNumberFilterRule) },
{ SchemaTypeNames.XmlaStringFilterRuleType, typeof(XmlaStringFilterRule) },
};
}
}
}
6 changes: 4 additions & 2 deletions src/Reveal.Sdk.Dom/Filters/XmlaFilterRule.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Reveal.Sdk.Dom.Core;
using Newtonsoft.Json;
using Reveal.Sdk.Dom.Core;
using Reveal.Sdk.Dom.Core.Serialization.Converters;

namespace Reveal.Sdk.Dom.Filters
{
//todo: need converter XmlaNumberFilterRuleType XmlaStringFilterRuleType
[JsonConverter(typeof(XmlaFilterRuleConverter))]
public abstract class XmlaFilterRule : SchemaType
{

Expand Down

0 comments on commit f365b5e

Please sign in to comment.