public static DomReadOnlyMeta Create(IGetMeta getMeta) { Contract.Requires(getMeta.HasMeta()); var meta = getMeta.Meta; var domReadOnlyMeta = new DomReadOnlyMeta(meta); return(domReadOnlyMeta); }
public static TMetadata GetMetadata <TMetadata>(this IGetMeta getMeta) { Contract.Requires(getMeta != null); var meta = getMeta.Meta; if (meta == null) { return(default(TMetadata)); } var metadata = meta.GetData <TMetadata>(); return(metadata); }
// PUBLIC METHODS /////////////////////////////////////////////////// #region Extensions Methods public static void MapApiMetaToClrResource(this IResourceType resourceType, object clrResource, IGetMeta apiGetMeta) { Contract.Requires(resourceType != null); Contract.Requires(clrResource != null); Contract.Requires(apiGetMeta != null); var apiMeta = apiGetMeta.Meta; resourceType.SetClrMeta(clrResource, apiMeta); }
// PUBLIC METHODS /////////////////////////////////////////////////// #region IGetMeta Extension Methods public static bool HasMeta(this IGetMeta getMeta) { Contract.Requires(getMeta != null); return(getMeta.Meta != null); }
protected static void WriteMeta(JsonWriter writer, JsonSerializer serializer, IGetMeta getMeta) { Contract.Requires(writer != null); Contract.Requires(serializer != null); Contract.Requires(getMeta != null); if (getMeta.Meta == null) { return; } var metaJObject = (JObject)getMeta.Meta; writer.WritePropertyName(Keywords.Meta); metaJObject.WriteTo(writer); }
public void On(IGetMeta getMeta) => Meta.Execute(getMeta);