Пример #1
0
 public static void Initialize(JaConfiguration configuration)
 {
     if (factory == null)
     {
         factory = new JaBuilderFactory(configuration);
     }
 }
        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);
        }
Пример #3
0
 public static IBuilder GetBuilder(this Type type)
 {
     return(JaBuilderFactory.GetBuilder(type));
 }