public static void AddVxFormGenerator(this IServiceCollection services, Core.Layout.VxFormLayoutOptions vxFormLayoutOptions = null, VxComponentsRepository repository = null, VxFormOptions options = null)
 {
     FormGeneratorServiceServiceCollectionExtension.AddVxFormGenerator(services,
                                                                       vxFormLayoutOptions ?? new Core.Layout.VxFormLayoutOptions(),
                                                                       repository ?? new VxComponentsRepository(),
                                                                       options ?? new VxFormOptions());
 }
Пример #2
0
        public static void AddVxFormGenerator(IServiceCollection services, Core.Layout.VxFormLayoutOptions vxFormLayoutOptions = null, IFormGeneratorComponentsRepository repository = null, IFormGeneratorOptions options = null)
        {
            if (vxFormLayoutOptions == null)
            {
                throw new System.Exception("No layout options provided, please refer to the documentation.");
            }

            if (repository == null)
            {
                throw new System.Exception("No repository provided, please refer to the documentation.");
            }

            if (options == null)
            {
                throw new System.Exception("No options provided, please refer to the documentation.");
            }


            services.AddSingleton(typeof(IFormGeneratorComponentsRepository), repository);
            services.AddSingleton(typeof(IFormGeneratorOptions), options);
            services.AddSingleton(typeof(Core.Layout.VxFormLayoutOptions), vxFormLayoutOptions);
        }