1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-25 17:27:59 +00:00
Radarr/Marr.Data/QGen/DeleteQuery.cs
2013-07-23 23:27:30 -07:00

28 lines
757 B
C#

using Marr.Data.QGen.Dialects;
namespace Marr.Data.QGen
{
/// <summary>
/// This class creates a SQL delete query.
/// </summary>
public class DeleteQuery : IQuery
{
protected Table TargetTable { get; set; }
protected string WhereClause { get; set; }
protected Dialect Dialect { get; set; }
public DeleteQuery(Dialect dialect, Table targetTable, string whereClause)
{
Dialect = dialect;
TargetTable = targetTable;
WhereClause = whereClause;
}
public string Generate()
{
return string.Format("DELETE FROM {0} {1} ",
Dialect.CreateToken(TargetTable.Name),
WhereClause);
}
}
}