public static ICodecDefinition AsJsonNewtonsoft(
            this ICodecParentDefinition root,
            Action <NewtonsoftCodecOptions> options = null)
        {
            var opt = new NewtonsoftCodecOptions();

            options?.Invoke(opt);
            return(root.TranscodedBy <NewtonsoftJsonCodec>(opt));
        }
 public static ICodecDefinition TranscodedBy <TCodec>(this ICodecParentDefinition parent)
     where TCodec : ICodec
 {
     return(parent.TranscodedBy <TCodec>(null));
 }
 public static ICodecDefinition TranscodedBy(this ICodecParentDefinition parent, Type codecType)
 {
     return(parent.TranscodedBy(codecType, null));
 }
 public static ICodecDefinition AsXmlDataContract(this ICodecParentDefinition codecParent, Action <XmlWriterSettings> configuration = null)
 {
     return(codecParent.TranscodedBy <XmlDataContractCodec>(configuration));
 }
Exemple #5
0
 /// <summary>
 /// Adds an html rendering of a resource using a Razor view.
 /// </summary>
 public static ICodecDefinition RenderedByRazor(this ICodecParentDefinition codecParentDefinition, object viewVirtualPaths)
 {
     return(codecParentDefinition.TranscodedBy <RazorCodec>(viewVirtualPaths));
 }
Exemple #6
0
 /// <summary>
 /// Adds an html rendering of a resource using a Razor view.
 /// </summary>
 public static ICodecDefinition RenderedByRazor(this ICodecParentDefinition codecParentDefinition, string pageVirtualPath)
 {
     return(codecParentDefinition.TranscodedBy <RazorCodec>(new { index = pageVirtualPath }));
 }
Exemple #7
0
 /// <summary>
 /// Enables reading and writing resource representations using the framework's <see cref="XmlSerializer"/>.
 /// </summary>
 /// <param name="parentDefinition"></param>
 /// <returns></returns>
 public static ICodecDefinition AsXmlSerializer(this ICodecParentDefinition parentDefinition)
 {
     return(parentDefinition.TranscodedBy <XmlSerializerCodec>(null));
 }
 public static ICodecDefinition AsXmlDataContract(this ICodecParentDefinition codecParent)
 {
     return(codecParent.TranscodedBy <XmlDataContractCodec>());
 }
Exemple #9
0
 public static ICodecDefinition AndRenderedBySpark(this ICodecParentDefinition codecParentDefinition,
                                                   string config)
 {
     return(codecParentDefinition.TranscodedBy <SparkCodec>(new { TemplateName = config }));
 }
Exemple #10
0
 public static ICodecDefinition RenderedByUserControl(this ICodecParentDefinition codecParentDefinition, string userControlVirtualPath)
 {
     return(codecParentDefinition.TranscodedBy <WebFormsCodec>(new { index = userControlVirtualPath }).ForMediaType(MediaType.XhtmlFragment));
 }
Exemple #11
0
 public static ICodecDefinition RenderedByAspx(this ICodecParentDefinition codecParentDefinition, object viewVirtualPaths)
 {
     return(codecParentDefinition.TranscodedBy <WebFormsCodec>(viewVirtualPaths));
 }