{"id":19957714,"url":"https://github.com/hidayatarg/sms.providers","last_synced_at":"2026-06-08T04:32:55.766Z","repository":{"id":214964699,"uuid":"721089348","full_name":"hidayatarg/SMS.Providers","owner":"hidayatarg","description":"Using multiple SMS Provider with Dependency Injection using Strategy Pattern .Net7.0","archived":false,"fork":false,"pushed_at":"2024-01-01T14:13:36.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T16:12:35.575Z","etag":null,"topics":["asp-net-core","dependency-injection","strategy-pattern"],"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/hidayatarg.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}},"created_at":"2023-11-20T10:35:20.000Z","updated_at":"2024-03-05T02:44:54.000Z","dependencies_parsed_at":"2024-01-01T15:26:31.778Z","dependency_job_id":"0b94b36a-98b0-407c-9760-eba7e3ddce70","html_url":"https://github.com/hidayatarg/SMS.Providers","commit_stats":null,"previous_names":["hidayatarg/nt.sms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hidayatarg/SMS.Providers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidayatarg%2FSMS.Providers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidayatarg%2FSMS.Providers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidayatarg%2FSMS.Providers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidayatarg%2FSMS.Providers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hidayatarg","download_url":"https://codeload.github.com/hidayatarg/SMS.Providers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidayatarg%2FSMS.Providers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34048681,"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-08T02:00:07.615Z","response_time":111,"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":["asp-net-core","dependency-injection","strategy-pattern"],"created_at":"2024-11-13T01:38:46.055Z","updated_at":"2026-06-08T04:32:55.744Z","avatar_url":"https://github.com/hidayatarg.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Multiple SMS Providers with Dependency Injection using Strategy Pattern in .net-core 7.0\n\n## SmsService\n\nThe `SmsService` is a part of the NT.Sms namespace, designed to facilitate sending SMS messages through various providers. It is implemented in C# using ASP.NET Core 7, making use of the SMS models and providers within the NT.Sms library.\n\n## Overview\n\nThe `SmsService` class is responsible for sending SMS messages through different providers. It utilizes an IEnumerable of ISmsProvider to support multiple providers seamlessly.\n\n## Usage\n\nTo use the `SmsService`, create an instance of it by providing an IEnumerable of ISmsProvider during initialization. This allows you to inject different SMS providers dynamically.\n\n```csharp\nvar smsProviders = new List\u003cISmsProvider\u003e\n{\n    new NexmoSmsProvider(),   // Example provider implementation\n    new TwilioSmsProvider(),\n    // Add more providers as needed\n};\n\nvar smsService = new SmsService(smsProviders);\n```\n\nAfter initializing the `SmsService`, you can send an SMS by calling the `SendSms` method and providing the phone number and message.\n\n```csharp\nsmsService.SendSms(\"+123456789\", \"Hello, this is a test message!\");\n```\n\nThe `SendSms` method internally determines the SMS provider based on a provider name retrieved from the database. The provider name is then mapped to an enum value, and the corresponding SMS provider is selected from the injected list.\n\n### Supported Providers\n\n- Nexmo\n- Twilio\n- Rizon (default if the provider is not recognized)\n\n## Dependencies\n\n- ASP.NET Core\n- NT.Sms.Models\n- NT.Sms.Providers\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\nFeel free to customize this README according to your specific project needs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidayatarg%2Fsms.providers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhidayatarg%2Fsms.providers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidayatarg%2Fsms.providers/lists"}