示例#1
0
        public static LinksPolicyBuilder <TResource> RequiresPagingLinks <TResource>(this LinksPolicyBuilder <TResource> builder,
                                                                                     string currentId,
                                                                                     string nextId,
                                                                                     string previousId,
                                                                                     Action <LinkConditionBuilder <TResource> > configureCondition)
        {
            var conditionBuilder = new LinkConditionBuilder <TResource>();

            configureCondition?.Invoke(conditionBuilder);
            return(builder.RequiresPagingLinks(currentId, nextId, previousId, condition: conditionBuilder.Build()));
        }
示例#2
0
        public static LinksPolicyBuilder <TResource> RequireRoutedLink <TResource>(this LinksPolicyBuilder <TResource> builder,
                                                                                   string id,
                                                                                   string routeName,
                                                                                   Func <TResource, object> getValues,
                                                                                   Action <LinkConditionBuilder <TResource> > configureCondition)
        {
            var conditionBuilder = new LinkConditionBuilder <TResource>();

            configureCondition?.Invoke(conditionBuilder);
            return(builder.RequireRoutedLink(id, routeName, getValues: getValues, condition: conditionBuilder.Build()));
        }