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)) ); }); }
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()); }); }
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)); }); }); }