Пример #1
0
 public virtual DatabaseTableWindows GetDatabaseTable(string tableName)
 {
     if (!_tables.Exists(tableName))
     {
         return(null);
     }
     return((DatabaseTableWindows)_tables[tableName]);
 }
Пример #2
0
        public OrmTypeWindows CreateOrmType(string typeName, bool prefixWithAssemblyNamespace)
        {
            if (_ormTypes.Exists(typeName))
            {
                throw new ArgumentException(string.Format(
                                                "{0} with {1} {2} already created on {3}.",
                                                typeof(OrmTypeWindows).FullName,
                                                EntityReaderGeneric <OrmTypeWindows> .GetPropertyName(p => p.TypeName, false),
                                                typeName,
                                                this.GetType().FullName));
            }
            if (prefixWithAssemblyNamespace)
            {
                typeName = string.Format("{0}.{1}", _assemblyName, typeName);
            }
            TypeBuilder        typeBuilder        = _moduleBuilder.DefineType(typeName, TypeAttributes.Class | TypeAttributes.Public);
            ConstructorBuilder constructorBuilder = typeBuilder.DefineDefaultConstructor(MethodAttributes.Public);
            OrmTypeWindows     result             = new OrmTypeWindows(typeName, typeBuilder);

            _ormTypes.Add(result.TypeName, result);
            return(result);
        }