public static void ConfigureJsonAPI(this HttpConfiguration configuration, Action <JaConfiguration> action)
        {
            configuration.MessageHandlers.Add(new JaDelegatingHandler());
            //configuration.Formatters.Clear();
            configuration.Formatters.Insert(0, new JaMediaTypeFormatter());

            JaConfiguration config = new JaConfiguration();

            action?.Invoke(config);

            JaBuilderFactory.Initialize(config);

            JaTemplates.Intialize(config.TemplateDirectory ?? Constants.DEFAULT_TEMPLATE_PATH);
        }
Ejemplo n.º 2
0
 public JaError()
 {
     template = JaTemplates.GetTemplate(Constants.ERROR_TEMPLATE_NAME);
 }
Ejemplo n.º 3
0
 protected virtual JObject GetTemplate(string templateName)
 {
     return(JaTemplates.GetTemplate(templateName));
 }
Ejemplo n.º 4
0
 public JaRelationship(object value)
 {
     this.value = value;
     template   = JaTemplates.GetTemplate(Constants.RELATIONSHIP_TEMPLATE_NAME);
 }