1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-30 19:56:54 +00:00
Sonarr/Marr.Data/QGen/Table.cs
2013-07-18 20:47:55 -07:00

47 lines
1.1 KiB
C#

using System;
using Marr.Data.Mapping;
namespace Marr.Data.QGen
{
/// <summary>
/// This class represents a table in a query.
/// A table contains corresponding columns.
/// </summary>
public class Table
{
public Table(Type memberType)
: this(memberType, JoinType.None)
{ }
public Table(Type memberType, JoinType joinType)
{
EntityType = memberType;
Name = memberType.GetTableName();
JoinType = joinType;
Columns = MapRepository.Instance.GetColumns(memberType);
}
public bool IsBaseTable
{
get
{
return Alias == "t0";
}
}
public Type EntityType { get; private set; }
public virtual string Name { get; set; }
public JoinType JoinType { get; private set; }
public virtual ColumnMapCollection Columns { get; private set; }
public virtual string Alias { get; set; }
public string JoinClause { get; set; }
}
public enum JoinType
{
None,
Inner,
Left,
Right
}
}