Skip to content

Commit 2702d57

Browse files
authored
Merge pull request #451 from GridProtectionAlliance/PivotSearch
return pivot cols so that we may view relevant information when searc…
2 parents 1a17128 + 12f909d commit 2702d57

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Source/Libraries/GSF.Web/Model/ModelController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,13 @@ public ModelController()
163163
#region [ Properties ]
164164
protected bool ViewOnly { get; } = false;
165165
protected bool AllowSearch { get; } = false;
166+
protected bool ReturnPivots { get; set; } = false;
166167
protected string CustomView { get; } = "";
167168
protected string PrimaryKeyField { get; set; } = "ID";
168169
protected string ParentKey { get; set; } = "";
169170

170171
[Obsolete("Creating AdoDataConnection with this property may ignore DbTimeout Settings in some repositories, please use ConnectionFactory instead.")]
171-
protected string Connection { get; } = "systemSettings";
172+
protected string Connection { get; } = "systemSettings";
172173
public Func<AdoDataConnection> ConnectionFactory { get; set; }
173174
protected string DefaultSort { get; } = null;
174175
protected string GetRoles { get; } = "";
@@ -823,7 +824,7 @@ SELECT TOP 0 * INTO #Tbl FROM {tblSelect}
823824
FROM tempdb.sys.columns WHERE object_id = Object_id('tempdb..#Tbl') AND name NOT LIKE 'AFV%';";
824825
sqlNoPivot = string.Join(",", connection.RetrieveData(sqlNoPivot).Select().Select(r => r[0].ToString()));
825826
sql = $@"
826-
SELECT {limit} {sqlNoPivot} FROM {tblSelect}
827+
SELECT {limit} {(ReturnPivots ? "*" : sqlNoPivot)} FROM {tblSelect}
827828
{whereClause}
828829
ORDER BY {postData.OrderBy} {(postData.Ascending ? "ASC" : "DESC")}";
829830
}

0 commit comments

Comments
 (0)