Exemple #1
0
 protected void RefreshResolveTypeInterceptors()
 {
     ResolveTypesInterceptors = new List <IResolveTypeInterceptor>();
     DynamicAssemblies.ForEach(da =>
     {
         ResolveTypesInterceptors.AddRange(da.GetTypes()
                                           .Where(t => t.IsClass && typeof(IResolveTypeInterceptor).IsAssignableFrom(t))
                                           .Select(t => (IResolveTypeInterceptor)Activator.CreateInstance(t, (IGenerator)this))
                                           );
     });
 }
Exemple #2
0
        private void ContextHook()
        {
            DynamicAssemblies.ForEach(a =>
            {
                var contextServices = a.GetTypes()
                                      .Where(t => t.IsClass && typeof(IContextInterceptor).IsAssignableFrom(t))
                                      .Select(t => (IContextInterceptor)Activator.CreateInstance(t, (IGenerator)this))
                                      .ToList();

                contextServices.ForEach(c => c.InterceptContext());
            });
        }
Exemple #3
0
        private void EachTableHooks()
        {
            DynamicAssemblies.ForEach(a =>
            {
                var eachTableServices = a.GetTypes()
                                        .Where(t => t.IsClass && typeof(ITableInterceptor).IsAssignableFrom(t))
                                        .Select(t => (ITableInterceptor)Activator.CreateInstance(t, (IGenerator)this))
                                        .ToList();

                TablesToGenerate.ForEach(table =>
                {
                    eachTableServices.ForEach(t => t.InterceptTable(table));
                });
            });
        }