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