public virtual void Skipped(ILinksRequirement requirement, LinkRequirementSkipReason reason = LinkRequirementSkipReason.Custom, string message = null)
        {
            var username = User?.Identity?.Name ?? "Unknown";

            Logger.LogInformation("Link {Requirement} skipped for user {User}. Reason: {LinkSkipReason}. {Message}.", requirement, username, reason, message ?? String.Empty);
            pendingRequirements.Remove(requirement);
        }
            private Link CreateLink(ILinksRequirement option, string method, object routeValues)
            {
                var url  = _urlHelper.Link(option.Name, routeValues).ToLower();
                var link = new Link(option.Name, url, method);

                return(link);
            }
Exemplo n.º 3
0
        public static Task AddLinksAsync <T>(this ILinksService service, T linkContainer, ILinksRequirement requirement) where T : ILinkContainer
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }
            if (requirement == null)
            {
                throw new ArgumentNullException(nameof(requirement));
            }

            return(service.AddLinksAsync(linkContainer, new[] { requirement }));
        }
        private HateoasOptions Add(ILinksRequirement req)
        {
            _links.Add(req);

            return(this);
        }
 public virtual void Handled(ILinksRequirement requirement)
 {
     pendingRequirements.Remove(requirement);
 }