1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/Marr.Data/QGen/DeleteQuery.cs

29 lines
757 B
C#
Raw Normal View History

2013-07-24 08:35:32 +03:00
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; }
2013-07-24 08:35:32 +03:00
protected Dialect Dialect { get; set; }
2013-07-24 08:35:32 +03:00
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);
}
}
}