コード例 #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;
 }