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);
        }
Beispiel #2
0
 public JaError()
 {
     template = JaTemplates.GetTemplate(Constants.ERROR_TEMPLATE_NAME);
 }
Beispiel #3
0
 protected virtual JObject GetTemplate(string templateName)
 {
     return(JaTemplates.GetTemplate(templateName));
 }
Beispiel #4
0
 public JaRelationship(object value)
 {
     this.value = value;
     template   = JaTemplates.GetTemplate(Constants.RELATIONSHIP_TEMPLATE_NAME);
 }