public BaseRequestModel(string keyword, string orderBy = "Modified", string isAscending = "False") { if (string.IsNullOrEmpty(keyword)) { keyword = ""; } Page = 1; Keyword = keyword.ToLower(); if (!string.IsNullOrWhiteSpace(orderBy)) { OrderBy = orderBy; } if (!string.IsNullOrWhiteSpace(isAscending)) { IsAscending = isAscending; } if (string.IsNullOrWhiteSpace(OrderBy)) { OrderBy = "Modified"; isAscending = "False"; } Request = new OrderByRequest { PropertyName = string.IsNullOrWhiteSpace(OrderBy) ? "Modified" : OrderBy, IsAscending = string.IsNullOrWhiteSpace(isAscending) ? false : bool.Parse(isAscending) }; }
protected RequestModel(string keyword, string orderBy, string isAscending) { if (string.IsNullOrEmpty(keyword)) { keyword = ""; } Page = 1; PerPageCount = 10; Keyword = keyword.ToLower(); _request = new OrderByRequest { PropertyName = string.IsNullOrWhiteSpace(orderBy) ? "Modified" : orderBy, IsAscending = isAscending == "True" }; }
protected RequestModel(string keyword, string orderBy, string isAscending) { if (string.IsNullOrEmpty(keyword)) { keyword = ""; } Page = 1; Keyword = keyword.ToLower(); if (!string.IsNullOrWhiteSpace(orderBy)) { OrderBy = orderBy; } if (!string.IsNullOrWhiteSpace(isAscending)) { IsAscending = isAscending; } Request = new OrderByRequest { PropertyName = string.IsNullOrWhiteSpace(OrderBy) ? "Modified" : OrderBy, IsAscending = IsAscending == "True" }; }