public static Type GetSetupClass(Assembly assembly)
        {
            var types = assembly.GetTypesWithAttribute(typeof(SetupAttribute));
            var enumerator = types.GetEnumerator();
            if (enumerator.MoveNext())
                return enumerator.Current;

            return null;
        }
        public static Type GetDriver(Assembly assembly)
        {
            var types = assembly.GetTypesWithAttribute(typeof (DriverAttribute));
            var enumerator = types.GetEnumerator();
            if (! enumerator.MoveNext())
                throw new Exception("No driver found.");

            return enumerator.Current;
        }
 public static IEnumerable<Type> GetTypes(Assembly assembly)
 {
     return assembly.GetTypesWithAttribute(typeof(MigrationAttribute));
 }