Skip to content

Commit 997837c

Browse files
committed
Add Query.GetComment()
1 parent e225c73 commit 997837c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

QueryBuilder/Query.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ namespace SqlKata
66
{
77
public partial class Query : BaseQuery<Query>
88
{
9+
private string comment;
10+
911
public bool IsDistinct { get; set; } = false;
1012
public string QueryAlias { get; set; }
1113
public string Method { get; set; } = "select";
12-
public string QueryComment { get; set; }
1314
public List<Include> Includes = new List<Include>();
1415

1516
public Query() : base()
@@ -22,6 +23,7 @@ public Query(string table, string comment = null) : base()
2223
Comment(comment);
2324
}
2425

26+
public string GetComment() => comment ?? "";
2527

2628
public bool HasOffset(string engineCode = null) => GetOffset(engineCode) > 0;
2729

@@ -59,9 +61,14 @@ public Query As(string alias)
5961
return this;
6062
}
6163

64+
/// <summary>
65+
/// Sets a comment for the query.
66+
/// </summary>
67+
/// <param name="comment">The comment.</param>
68+
/// <returns></returns>
6269
public Query Comment(string comment)
6370
{
64-
QueryComment = comment;
71+
this.comment = comment;
6572
return this;
6673
}
6774

0 commit comments

Comments
 (0)