forked from ThatRendle/Simple.Data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathValueResolver.cs
More file actions
28 lines (24 loc) · 1.2 KB
/
ValueResolver.cs
File metadata and controls
28 lines (24 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Simple.Data.QueryPolyfills
{
abstract class ValueResolver
{
public static ValueResolver Create(SimpleReference reference)
{
var objectReference = reference as ObjectReference;
if (!ReferenceEquals(null, objectReference)) return new ObjectValueResolver(objectReference);
var functionReference = reference as FunctionReference;
if (!ReferenceEquals(null, functionReference))
{
if (FunctionHandlers.Exists(functionReference.Name)) return new AggregateValueResolver(functionReference);
return new FunctionValueResolver(functionReference);
}
throw new InvalidOperationException("Unresolvable Reference type.");
}
public abstract void CopyValue(IDictionary<string, object> source, IDictionary<string, object> target, IEnumerable<IDictionary<string,object>> sourceAggregationValues = null);
public abstract object GetValue(IDictionary<string, object> source, IEnumerable<IDictionary<string, object>> sourceAggregationValues = null);
}
}