...
Code Block | ||
---|---|---|
| ||
return employments .Where(a => a.EmploymentState.Id != (uint)CoreIdentityEmploymentStates.Deleted) .OrderByDescending(a => a.EmploymentState.Id) .ThenByDescending(a => a.MainEmployment) .ThenByDescending(a => a.ValidFrom <= DateTime.Now && (!a.ValidTo.HasValue || a.ValidTo.Value >= DateTime.Now.Date)) .ThenByDescending(a => a.Percentage) .ThenBy(a => a.ValidFrom) .ThenBy(a => a.ValidTo.HasValue) .ThenBy(a => a.ValidTo) .ThenBy(a => a.Id); |
For further information there are also how-tos related to this topic: