diff --git a/Bootstrap.Admin/Controllers/Api/GroupsController.cs b/Bootstrap.Admin/Controllers/Api/GroupsController.cs index 72d6db33..2f454987 100644 --- a/Bootstrap.Admin/Controllers/Api/GroupsController.cs +++ b/Bootstrap.Admin/Controllers/Api/GroupsController.cs @@ -19,7 +19,7 @@ namespace Bootstrap.Admin.Controllers.Api /// /// [HttpGet] - public QueryData Get(QueryGroupOption value) + public QueryData Get(QueryGroupOption value) { return value.RetrieveData(); } diff --git a/Bootstrap.Admin/Query/QueryGroupOption.cs b/Bootstrap.Admin/Query/QueryGroupOption.cs index f12bd1a3..e09d4cfb 100644 --- a/Bootstrap.Admin/Query/QueryGroupOption.cs +++ b/Bootstrap.Admin/Query/QueryGroupOption.cs @@ -21,7 +21,7 @@ namespace Bootstrap.Admin.Query /// /// /// - public QueryData RetrieveData() + public QueryData RetrieveData() { // int limit, int offset, string name, string price, string sort, string order var data = GroupHelper.RetrieveGroups(); @@ -33,10 +33,10 @@ namespace Bootstrap.Admin.Query { data = data.Where(t => t.Description.Contains(Description)); } - var ret = new QueryData(); + var ret = new QueryData(); ret.total = data.Count(); data = Order == "asc" ? data.OrderBy(t => t.GroupName) : data.OrderByDescending(t => t.GroupName); - ret.rows = data.Skip(Offset).Take(Limit); + ret.rows = data.Skip(Offset).Take(Limit).Select(g => new { g.Id, g.GroupName, g.Description }); return ret; } }