namespace Framework.DataAccessLayer
{
using System;
///
/// Base class for every database row. (Table and view).
///
public class Row
{
}
///
/// Base class for every database cell.
///
internal class Cell
{
///
/// Gets Row. Null, if column definition.
///
public object Row { get; private set; }
}
///
/// Base class for every database cell.
///
internal class Cell : Cell where TRow : Row
{
public new TRow Row
{
get
{
return (TRow)base.Row;
}
}
}
///
/// Sql schema name and table name.
///
public class SqlTableAttribute : Attribute
{
public SqlTableAttribute(string schemaNameSql, string tableNameSql)
{
this.SchemaNameSql = schemaNameSql;
this.TableNameSql = tableNameSql;
}
public readonly string SchemaNameSql;
public readonly string TableNameSql;
}
///
/// Sql field name.
///
public class SqlFieldAttribute : Attribute
{
public SqlFieldAttribute(string fieldNameSql, bool isPrimaryKey, FrameworkTypeEnum frameworkTypeEnum)
{
this.FieldNameSql = fieldNameSql;
this.IsPrimaryKey = isPrimaryKey;
this.FrameworkTypeEnum = frameworkTypeEnum;
}
public SqlFieldAttribute(string fieldNameSql, FrameworkTypeEnum frameworkTypeEnum)
: this(fieldNameSql, false, frameworkTypeEnum)
{
}
///
/// Gets or sets FieldNameSql. If null, it's a calculated field.
///
public readonly string FieldNameSql;
public readonly bool IsPrimaryKey;
// public readonly Type TypeCell;
///
/// Gets FrameworkTypeEnum. See also class FrameworkType.
///
public readonly FrameworkTypeEnum FrameworkTypeEnum;
}
}