{"id":21480427,"url":"https://github.com/amirdoosti6060/backgroundservicedemo","last_synced_at":"2026-05-20T09:05:36.846Z","repository":{"id":217077194,"uuid":"743046994","full_name":"amirdoosti6060/BackgroundServiceDemo","owner":"amirdoosti6060","description":"A small sample that shows how to create and register background service in .Net","archived":false,"fork":false,"pushed_at":"2024-01-14T07:08:53.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T09:11:42.177Z","etag":null,"topics":["asynchronous-programming","background-service","csharp","dotnet"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/pulse/background-services-cnet-amir-doosti-e3vcf","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/amirdoosti6060.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":"2024-01-14T06:36:55.000Z","updated_at":"2024-01-14T07:08:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f81e1a4-55c1-4067-956d-1180efa4af3c","html_url":"https://github.com/amirdoosti6060/BackgroundServiceDemo","commit_stats":null,"previous_names":["amirdoosti6060/backgroundservicedemo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amirdoosti6060/BackgroundServiceDemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirdoosti6060%2FBackgroundServiceDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirdoosti6060%2FBackgroundServiceDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirdoosti6060%2FBackgroundServiceDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirdoosti6060%2FBackgroundServiceDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amirdoosti6060","download_url":"https://codeload.github.com/amirdoosti6060/BackgroundServiceDemo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirdoosti6060%2FBackgroundServiceDemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33253046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T04:48:54.280Z","status":"ssl_error","status_checked_at":"2026-05-20T04:48:10.851Z","response_time":356,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["asynchronous-programming","background-service","csharp","dotnet"],"created_at":"2024-11-23T12:14:59.345Z","updated_at":"2026-05-20T09:05:36.826Z","avatar_url":"https://github.com/amirdoosti6060.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BackgroundServiceDemo\n\n## Introduction\nThis project provide a sample that shows how to implement a **Background Service** in .Net 6.  \nI also wrote an article in the following address that completely explains **Background Services**:  \nhttps://www.linkedin.com/pulse/background-services-cnet-amir-doosti-e3vcf \n\n## Structure of soution\nThe solution contains one Console App project which is written in Visual Studio. The project contains a **Worker** class which runs in the background and generate strings with random numbers. It raise an event almost every 1 second and deliver the message. In Program.cs, our Worker class is registered and also subscribed to receive event and write it down to the console. Please note how I used **Singleton Registeration** technique.\n\n## Technology stack\n- OS: Windows 10 Enterprise - 64 bits\n- IDE: Visual Studio Enterprise 2022 (64 bits) - version 17.2.5\n- Framework: .Net 6\n- Language: C#\n\n## How to run\nOpen the solution in Visual Studio and run it using F5. You will see the output in a console.  \nPress Ctrl+C to exit the program.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirdoosti6060%2Fbackgroundservicedemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famirdoosti6060%2Fbackgroundservicedemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirdoosti6060%2Fbackgroundservicedemo/lists"}