public void ReplaceSorting_Test() { var sorting = "UserName desc, Age asc"; DtoSortingHelper.ReplaceSorting(sorting, s => { if (s == "UserName desc") { s = "username desc"; } if (s == "Age asc") { s = "age asc"; } return(s); }).ShouldBe("username desc,age asc"); sorting = "UserName desc"; DtoSortingHelper.ReplaceSorting(sorting, s => { if (s == "UserName desc") { s = "username desc"; } return(s); }).ShouldBe("username desc"); }
public void Normalize() { if (string.IsNullOrEmpty(Sorting)) { Sorting = "TenancyName"; } Sorting = DtoSortingHelper.ReplaceSorting(Sorting, s => { return(s.Replace("editionDisplayName", "Edition.DisplayName")); }); }
public void Normalize() { if (string.IsNullOrEmpty(Sorting) || Sorting == "userName ASC") { Sorting = "Username"; } Sorting = DtoSortingHelper.ReplaceSorting(Sorting, s => { if (s == "userName DESC") { s = "UserName DESC"; } return(s); }); }
public void Normalize() { if (Sorting.IsNullOrWhiteSpace()) { Sorting = "ExecutionTime DESC"; } Sorting = DtoSortingHelper.ReplaceSorting(Sorting, s => { if (s.IndexOf("UserName", StringComparison.OrdinalIgnoreCase) >= 0) { s = "User." + s; } else { s = "AuditLog." + s; } return(s); }); }
public void Normalize() { if (string.IsNullOrEmpty(Sorting)) { Sorting = "user.Name, user.Surname"; } Sorting = DtoSortingHelper.ReplaceSorting(Sorting, s => { if (s.Contains("userName")) { s = s.Replace("userName", "user.userName"); } if (s.Contains("addedTime")) { s = s.Replace("addedTime", "ouUser.creationTime"); } return(s); }); }
public void Normalize() { if (string.IsNullOrEmpty(Sorting)) { Sorting = "role.DisplayName, role.Name"; } Sorting = DtoSortingHelper.ReplaceSorting(Sorting, s => { if (s.Contains("displayName")) { s = s.Replace("displayName", "role.displayName"); } if (s.Contains("addedTime")) { s = s.Replace("addedTime", "ouRole.creationTime"); } return(s); }); }