Пример #1
0
        private void Construct()
        {
            this.SchemaName = typeof(TEntity).GetAttributeValue((SchemaNameAttribute attr) => attr.SchemaName);
            this.TableName  = typeof(TEntity).GetAttributeValue((TableNameAttribute attr) => attr.TableName);
            this.PrimaryKey = typeof(TEntity).GetAttributeValue((PrimaryKeyAttribute attr) => attr.ColumnName);
            if (this.DatabaseOptions == null)
            {
                var databaseOptions = typeof(TEntity).GetAttributeValue((PocoDatabaseOptionsAttribute pdo) => pdo.DatabaseOptions);
                if (databaseOptions != null)
                {
                    this.DatabaseOptions = databaseOptions;
                }
            }

            if (this.DatabaseOptions == null)
            {
                if (PocoStatic.DefaultOptions != null)
                {
                    this.DatabaseOptions = PocoStatic.DefaultOptions;
                }
            }
        }
Пример #2
0
 public PocoDatabaseOptionsAttribute(DatabaseEngine databaseEngine, string connectionString)
 {
     this.DatabaseOptions = new PocoDatabaseOptions(databaseEngine, connectionString);
 }
Пример #3
0
 public PocoDatabaseOptionsAttribute(PocoDatabaseOptions databaseOptions)
 {
     this.DatabaseOptions = databaseOptions;
 }
Пример #4
0
 public static void SetDefaultOptions(DatabaseEngine databaseEngine, string connectionString)
 {
     DefaultOptions = new PocoDatabaseOptions(databaseEngine, connectionString);
 }
Пример #5
0
 public static void SetDefaultOptions(PocoDatabaseOptions databaseOptions)
 {
     DefaultOptions = databaseOptions;
 }