/// <summary>
        /// Adds hierarchy tools.
        /// </summary>
        /// <param name="services">IServiceCollection</param>
        /// <param name="setupAction">Action to configure settings.</param>
        /// <returns>IServiceCollection</returns>
        public static IServiceCollection AddHierarchyToolsForStringId <T>(this IServiceCollection services, Action <HierarchyOptions> setupAction) where T : class, IHierarchyItem <T, string, string>
        {
            var settings = new HierarchyOptions();

            setupAction(settings);

            services.AddSingleton(settings);

            services.AddSingleton <IHierarchyTools <T, string, string>, HierarchyToolsForStringId <T> >();

            return(services);
        }
Exemple #2
0
 public HierarchyToolsForIntId(HierarchyOptions options)
 {
     _options = options;
 }
Exemple #3
0
 public HierarchyToolsForStringId(HierarchyOptions options)
 {
     _options = options;
 }