private object GetEntryValue(string propertyName) { var value = base[propertyName]; if (value is IDictionary<string, object>) value = new DynamicODataEntry(value as IDictionary<string, object>); return value; }
private object GetEntryValue(string propertyName) { var value = base[propertyName]; if (value is IDictionary <string, object> ) { value = new DynamicODataEntry(value as IDictionary <string, object>, TypeCache); } return(value); }
public override DynamicMetaObject BindGetMember(GetMemberBinder binder) { var odataEntry = base.Value as DynamicODataEntry; if (odataEntry.AsDictionary().ContainsKey(binder.Name)) { var value = odataEntry.AsDictionary()[binder.Name]; if (value is IDictionary<string, object>) value = new DynamicODataEntry(value as IDictionary<string, object>); Expression objectExpression = Expression.Constant(value); if (value != null && value.GetType().IsValueType) { objectExpression = Expression.Convert(objectExpression, typeof(object)); } return new DynamicMetaObject( objectExpression, BindingRestrictions.GetTypeRestriction(Expression, LimitType)); } return base.BindGetMember(binder); }
internal DynamicEntryMetaObject( Expression parameter, DynamicODataEntry value) : base(parameter, BindingRestrictions.Empty, value) { }
internal DynamicEntryMetaObject(Expression parameter, DynamicODataEntry value) : base(parameter, BindingRestrictions.Empty, value) { TypeCache = value.TypeCache; }