/// <summary> /// Can be used to setup various bits of data that are normally created on the fly as the system is used. /// Also calls initialization code found in mappings. /// </summary> public void Setup() { Utilities.Reflection.AOP.AOPManager Manager = new Reflection.AOP.AOPManager(); foreach (Type Key in MappingManager.Mappings.Keys) { foreach (IMapping Mapping in MappingManager.Mappings[Key]) { Manager.Setup(Mapping.ObjectType); } } MappingManager.Initialize(); }
private void Setup(Assembly Assembly) { MappingManager = new MappingManager(Assembly); QueryProvider = new Default(Assembly); foreach (Type Key in MappingManager.Mappings.Keys) { foreach (IMapping Mapping in MappingManager.Mappings[Key]) { QueryProvider.AddMapping(Mapping); } } Utilities.Reflection.AOP.AOPManager Manager = new Reflection.AOP.AOPManager(); Manager.AddAspect(new ORMAspect(MappingManager.Mappings)); DatabaseManager = new DatabaseManager(QueryProvider.Mappings); DatabaseManager.Setup(); }
/// <summary> /// Sets up the system /// </summary> /// <param name="AssemblyUsing">Assembly to set up</param> private void Setup(Assembly AssemblyUsing) { if (Databases == null) { Databases = new System.Collections.Generic.List <IDatabase>(); } IEnumerable <Type> Types = AssemblyUsing.Types(typeof(IDatabase)); foreach (Type Type in Types) { IDatabase TempObject = (IDatabase)Activator.CreateInstance(Type); if (!string.IsNullOrEmpty(TempObject.ConnectionString)) { SQLHelper.Database(TempObject.ConnectionString, TempObject.Name); Databases.Add(TempObject); } } Manager = new Reflection.AOP.AOPManager(); }
private static void Setup(bool Profile, Assembly[] Assemblies) { MappingManager = new MappingManager(Assemblies); QueryProvider = new Default(Profile, Assemblies); foreach (Type Key in MappingManager.Mappings.Keys) foreach (IMapping Mapping in MappingManager.Mappings[Key]) QueryProvider.AddMapping(Mapping); Company.Utilities.Reflection.AOP.AOPManager Manager = new Reflection.AOP.AOPManager(); Manager.AddAspect(new ORMAspect(MappingManager.Mappings)); DatabaseManager = new DatabaseManager(QueryProvider.Mappings); DatabaseManager.Setup(); }
public void Setup() { Company.Utilities.Reflection.AOP.AOPManager Manager = new Reflection.AOP.AOPManager(); foreach (Type Key in MappingManager.Mappings.Keys) foreach (IMapping Mapping in MappingManager.Mappings[Key]) Manager.Setup(Mapping.ObjectType); Manager.Save(); MappingManager.Initialize(); }
private void Setup(Assembly Assembly) { MappingManager = new MappingManager(Assembly); QueryProvider = new Default(Assembly); foreach (Type Key in MappingManager.Mappings.Keys) foreach (IMapping Mapping in MappingManager.Mappings[Key]) QueryProvider.AddMapping(Mapping); Utilities.Reflection.AOP.AOPManager Manager = new Reflection.AOP.AOPManager(); Manager.AddAspect(new ORMAspect(MappingManager.Mappings)); DatabaseManager = new DatabaseManager(QueryProvider.Mappings); DatabaseManager.Setup(); }