Exemple #1
0
        /// <summary>
        /// Gets a NrdoTable object corresponding to the given type.
        /// </summary>
        /// <param name="type">The type corresponding to the table to get</param>
        /// <returns>A NrdoTable object corresponding to the given type</returns>
        public static NrdoTable GetTable(Type type)
        {
            Assembly assembly = type.Assembly;
            string   name     = NrdoCodeBase.getTableNameFromType(type);

            if (name == null || NrdoReflection.MangleName(assembly, name) != type.FullName)
            {
                throw new ArgumentException(type.FullName + " is not a valid nrdo database table class: " + name + " mangles to " + NrdoReflection.MangleName(assembly, name));
            }
            NrdoTable result = NrdoCodeBase.getTableInternal(assembly, name, type);

            if (result == null)
            {
                throw new ArgumentException(type.FullName + " is not a valid nrdo database table class");
            }
            return(result);
        }
Exemple #2
0
        public static NrdoQuery GetQuery(Type type)
        {
            Assembly assembly = type.Assembly;
            string   name     = NrdoCodeBase.getQueryNameFromType(type);
            var      mangled  = name == null ? null : NrdoReflection.MangleName(assembly, name);

            if (name == null || mangled != type.FullName)
            {
                throw new ArgumentException(type.FullName + " is not a valid nrdo database query class (name = " + (name ?? "null") + ", mangled = " + (mangled ?? "null") + ")");
            }
            NrdoQuery result = NrdoCodeBase.getQueryInternal(assembly, name, type);

            if (result == null)
            {
                throw new ArgumentException(type.FullName + " is not a valid nrdo database query class");
            }
            return(result);
        }
Exemple #3
0
 public static INrdoCodeBase GetCodeBase(ILookupAssemblies lookup)
 {
     return(NrdoCodeBase.Get(lookup));
 }