public void Write(IProjectionContext <TParent> context, IMediaNode node) { var value = context.ValueFor(_accessor); if (value != null) { _projector.Project(AttributeName, (T)value, node); } }
void IProjection <TParent> .Write(IProjectionContext <TParent> context, IMediaNode node) { var value = context.ValueFor(_accessor) as TChild; if (value == null) { return; } var childNode = node.AddChild(_name); var childContext = context.ContextFor(value); write(childContext, childNode); }
public static string FormattedValueOf <T>(this IProjectionContext <T> context, Accessor accessor) { return(context.Formatter.GetDisplayForValue(accessor, context.ValueFor(accessor))); }