History

Merge branch 'master' of github.com:GridProtectionAlliance/gsf

gsfbuildbot committed 4 years ago

Commit f08c1fe2 parents f6b0f39 96feff05 files · +34 −29Browse files

Showing the changes to Source/Libraries/GSF.Web (1 of 5 files). Show all

Unified · Split

Source/Libraries/GSF.Web/Model/ModelController.cs+16−14
@@ -32,10 +32,11 @@ using System.Security.Claims; · 31 unmodified lines
3232 using System.Web.Http;
3333 using GSF.Data;
3434 using GSF.Data.Model;
35−using GSF.Reflection;
3635 using Newtonsoft.Json;
3736 using Newtonsoft.Json.Linq;
3837
38+#pragma warning disable CS1591 // TODO: Fix missing XML comments for publicly visible types and members
39+
3940 namespace GSF.Web.Model
4041 {
4142 /// <summary>
@@ -45,6 +46,7 @@ namespace GSF.Web.Model · 3 unmodified lines
4546 public class ModelController<T> : ApiController where T : class, new()
4647 {
4748 #region [ Members ]
49+
4850 /// <summary>
4951 /// Class Providing Search Parameters for the Search Endpoints
5052 /// </summary>
@@ -223,10 +225,10 @@ namespace GSF.Web.Model · 172 unmodified lines
223225 }
224226
225227 /// <summary>
226− /// Gets record from associated table with a primary key matching the id provided
228+ /// Gets record from associated table with a primary key matching the <paramref name="id"/> provided.
227229 /// </summary>
228230 /// <param name="id">ID to be used</param>
229− /// <returns><see cref="IHttpActionResult"/> containing <see cref="T"/> or <see cref="Exception"/></returns>
231+ /// <returns><see cref="IHttpActionResult"/> containing <typeparamref name="T"/> or <see cref="Exception"/></returns>
230232 [HttpGet, Route("One/{id}")]
231233 public virtual IHttpActionResult GetOne(string id)
232234 {
@@ -266,7 +268,7 @@ namespace GSF.Web.Model · 33 unmodified lines
266268 }
267269
268270 /// <summary>
269− /// Gets a sorted list of <see cref="T"/>.
271+ /// Gets a sorted list of <typeparamref name="T"/>.
270272 /// </summary>
271273 /// <param name="sort"> the Field to be sorted by.</param>
272274 /// <param name="ascending"> parameter to indicate whether the list is in ascending order.</param>
@@ -345,7 +347,7 @@ namespace GSF.Web.Model · 72 unmodified lines
345347 /// <summary>
346348 /// Adds a new Record.
347349 /// </summary>
348− /// <param name="record"> The <see cref="T"/> record to be added.</param>
350+ /// <param name="record"> The <typeparamref name="T"/> record to be added.</param>
349351 /// <returns><see cref="IHttpActionResult"/> containing the added record or <see cref="Exception"/> </returns>
350352 [HttpPost, Route("Add")]
351353 public virtual IHttpActionResult Post([FromBody] JObject record)
@@ -378,7 +380,7 @@ namespace GSF.Web.Model · 26 unmodified lines
378380 /// <summary>
379381 /// Updates an existing Record.
380382 /// </summary>
381− /// <param name="record"> The <see cref="T"/> record to be updated.</param>
383+ /// <param name="record"> The <typeparamref name="T"/> record to be updated.</param>
382384 /// <returns><see cref="IHttpActionResult"/> containing the updated record or <see cref="Exception"/> </returns>
383385
384386 [HttpPatch, Route("Update")]
@@ -424,7 +426,7 @@ namespace GSF.Web.Model · 39 unmodified lines
424426 /// <summary>
425427 /// Deletes an existing Record.
426428 /// </summary>
427− /// <param name="record"> The <see cref="T"/> record to be deleted.</param>
429+ /// <param name="record"> The <typeparamref name="T"/> record to be deleted.</param>
428430 /// <returns><see cref="IHttpActionResult"/> containing the number of records deleted or <see cref="Exception"/> </returns>
429431
430432 [HttpDelete, Route("Delete")]
@@ -481,7 +483,7 @@ namespace GSF.Web.Model · 50 unmodified lines
481483 }
482484
483485 /// <summary>
484− /// Gets all records from associated table, filtered and sorted as defined in <see cref="postData"/>.
486+ /// Gets all records from associated table, filtered and sorted as defined in <paramref name="postData"/>.
485487 /// </summary>
486488 /// <param name="postData"><see cref="PostData"/> containing the search and sort parameters</param>
487489 /// <returns><see cref="IHttpActionResult"/> containing <see cref="IEnumerable{T}"/> or <see cref="Exception"/></returns>
@@ -733,7 +735,7 @@ namespace GSF.Web.Model · 245 unmodified lines
733735 SELECT
734736 SRC.*,
735737 ''AFV_'' + AF.{SearchSettings.FieldKeyField} AS AFFieldKey,
736− AF.{SearchSettings.ValueField} AS AFValue
738+ AF.{SearchSettings.ValueField} AS AFValue
737739 FROM {tableName} SRC LEFT JOIN
738740 {SearchSettings.AdditionalFieldTable} AF ON {joinCondition}
739741 ) as FullTbl ' + (SELECT CASE WHEN Len(@PivotColumns) > 0 THEN 'PIVOT (
@@ -743,9 +745,9 @@ namespace GSF.Web.Model · 3 unmodified lines
743745 DECLARE @NoNPivotColumns NVARCHAR(MAX) = N''''
744746 SELECT @NoNPivotColumns = @NoNPivotColumns + ''[''+ name + ''],''
745747 FROM tempdb.sys.columns WHERE object_id = Object_id(''tempdb..#Tbl'') AND name NOT LIKE ''AFV%'';
746− DECLARE @CleanSQL NVARCHAR(MAX) = N''SELECT '' + SUBSTRING(@NoNPivotColumns,0, LEN(@NoNPivotColumns)) + ''FROM #Tbl ORDER BY { postData.OrderBy} {(postData.Ascending ? "ASC" : "DESC")}''
748+ DECLARE @CleanSQL NVARCHAR(MAX) = N''SELECT '' + SUBSTRING(@NoNPivotColumns,0, LEN(@NoNPivotColumns)) + ''FROM #Tbl ORDER BY { postData.OrderBy} {(postData.Ascending ? "ASC" : "DESC")}''
747749
748− exec sp_executesql @CleanSQL
750+ exec sp_executesql @CleanSQL
749751 '
750752 exec sp_executesql @SQLStatement";
751753 else
@@ -759,7 +761,7 @@ namespace GSF.Web.Model · 7 unmodified lines
759761 SELECT
760762 SRC.*,
761763 ''AFV_'' + AF.{SearchSettings.FieldKeyField} AS AFFieldKey,
762− AF.{SearchSettings.ValueField} AS AFValue
764+ AF.{SearchSettings.ValueField} AS AFValue
763765 FROM ({CustomView.Replace("'", "''")}) SRC LEFT JOIN
764766 {SearchSettings.AdditionalFieldTable} AF ON {joinCondition}
765767 ) as FullTbl ' + (SELECT CASE WHEN Len(@PivotColumns) > 0 THEN 'PIVOT (
@@ -769,9 +771,9 @@ namespace GSF.Web.Model · 3 unmodified lines
769771 DECLARE @NoNPivotColumns NVARCHAR(MAX) = N''''
770772 SELECT @NoNPivotColumns = @NoNPivotColumns + ''[''+ name + ''],''
771773 FROM tempdb.sys.columns WHERE object_id = Object_id(''tempdb..#Tbl'') AND name NOT LIKE ''AFV%'';
772− DECLARE @CleanSQL NVARCHAR(MAX) = N''SELECT '' + SUBSTRING(@NoNPivotColumns,0, LEN(@NoNPivotColumns)) + ''FROM #Tbl ORDER BY { postData.OrderBy} {(postData.Ascending ? "ASC" : "DESC")}''
774+ DECLARE @CleanSQL NVARCHAR(MAX) = N''SELECT '' + SUBSTRING(@NoNPivotColumns,0, LEN(@NoNPivotColumns)) + ''FROM #Tbl ORDER BY { postData.OrderBy} {(postData.Ascending ? "ASC" : "DESC")}''
773775
774− exec sp_executesql @CleanSQL
776+ exec sp_executesql @CleanSQL
775777 '
776778 exec sp_executesql @SQLStatement";
777779 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t