public static IResult <NonEmptyOrderByCollection, NonEmptyString> TryCreate(ImmutableList <OrderBy> orderBys)
        {
            var result = OrderByCollection.TryCreate(orderBys);

            if (result.IsFailure)
            {
                return(GetFailResult(result.Error));
            }

            return(result.Value.OrderBys.Count == 0 ? GetFailResult((NonEmptyString)("At least one " + nameof(OrderBys) + " is required")) : GetOkResult(new NonEmptyOrderByCollection(result.Value)));
        }
 private OrderByTopSkip(OrderByCollection orderByCollection, TopSkip topSkip)
 {
     TopSkip           = topSkip;
     OrderByCollection = orderByCollection;
 }
        public static IResult <OrderByTopSkip, NonEmptyString> TryCreate(OrderByCollection orderByCollection, int skip, int top, NonEmptyString skipField, NonEmptyString topField)
        {
            var topSkipResult = TopSkip.TryCreate(skip, top, skipField, topField);

            return(topSkipResult.OnSuccess(() => GetOkResult(new OrderByTopSkip(orderByCollection, topSkipResult.Value))));
        }
 private NonEmptyOrderByCollection(OrderByCollection orderByCollection)
 {
     _orderByCollection = orderByCollection;
 }