{"id":19654283,"url":"https://github.com/aimenux/conditionalendpointsdemo","last_synced_at":"2026-06-12T19:33:09.244Z","repository":{"id":116559658,"uuid":"459143472","full_name":"aimenux/ConditionalEndpointsDemo","owner":"aimenux","description":"Using various ways in order to conditionally disable endpoints","archived":false,"fork":false,"pushed_at":"2022-02-14T12:35:10.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T01:54:34.133Z","etag":null,"topics":["action-filter","conditional-endpoints","feature-flags","middleware","net60","vs22"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aimenux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-14T11:58:18.000Z","updated_at":"2022-02-14T12:30:15.000Z","dependencies_parsed_at":"2023-07-08T16:00:39.192Z","dependency_job_id":null,"html_url":"https://github.com/aimenux/ConditionalEndpointsDemo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aimenux/ConditionalEndpointsDemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FConditionalEndpointsDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FConditionalEndpointsDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FConditionalEndpointsDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FConditionalEndpointsDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aimenux","download_url":"https://codeload.github.com/aimenux/ConditionalEndpointsDemo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimenux%2FConditionalEndpointsDemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34260309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action-filter","conditional-endpoints","feature-flags","middleware","net60","vs22"],"created_at":"2024-11-11T15:16:49.735Z","updated_at":"2026-06-12T19:33:09.231Z","avatar_url":"https://github.com/aimenux.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![.NET](https://github.com/aimenux/ConditionalEndpointsDemo/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/aimenux/ConditionalEndpointsDemo/actions/workflows/ci.yml)\n\n# ConditionalEndpointsDemo\n```\nUsing various ways in order to conditionally disable endpoints\n```\n\nIn this demo, i m using various ways in order to disable some endpoints in production environment.\n\u003e\n\u003e :one: Using feature provider `ConditionalControllerProvider` to enable/disable endpoints based on environment.\n\u003e\n\u003e :two: Using action filter `ConditionalActionFilterAttribute` to enable/disable endpoints based on environment.\n\u003e\n\u003e :three: Using middleware `ConditionalMiddleware` to enable/disable endpoints based on environment.\n\u003e\n\u003e :four: Using [feature flags](https://github.com/microsoft/FeatureManagement-Dotnet) `ConditionalFeatureFilter` to enable/disable endpoints based on environment.\n\u003e\n\nThe first way is the simplest one in my opinion. The other ways needs more code to disable endpoints also in swagger.\n\nIn order to simulate the behaviour in production environment :\n\u003e\n\u003e :heavy_minus_sign: Open file `launchSettings.json` of some project for example `01-Way`\n\u003e\n\u003e :heavy_minus_sign: Edit the appropriate profile for example `_01_Way` or `IIS Express`\n\u003e\n\u003e :heavy_minus_sign: Set variable `ASPNETCORE_ENVIRONMENT` to `Production` value\n\n**`Tools`** : vs22, net 6.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimenux%2Fconditionalendpointsdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimenux%2Fconditionalendpointsdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimenux%2Fconditionalendpointsdemo/lists"}