Created
September 19, 2014 04:32
-
-
Save bwatts/27fcc995177402920ebe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class JsonbExpressionVisitor : ExpressionVisitor | |
{ | |
protected override Expression VisitExtension(Expression node) | |
{ | |
var jsonbNode = node as JsonbExpression; | |
return jsonbNode == null ? node : VisitJsonb(jsonbNode); | |
} | |
protected virtual Expression VisitJsonb(JsonbExpression node) | |
{ | |
switch(node.JsonbType) | |
{ | |
case JsonbType.Type1: | |
return VisitJsonbType1((JsonbType1) node); | |
case JsonbType.Type2: | |
return VisitJsonbType2((JsonbType2) node); | |
default: | |
return node; | |
} | |
} | |
protected virtual Expression VisitJsonbType1(JsonbType1 node) | |
{ | |
// Visit node parts | |
} | |
protected virtual Expression VisitJsonbType2(JsonbType2 node) | |
{ | |
// Visit node parts | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment