Skip to content
프로젝트

ardalis/CleanArchitecture.WorkerService

GitHub에서 보기

소개

.NET Core Worker Service를 구축하기 위한 클린 아키텍처 기반 솔루션 템플릿입니다.

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
+1
in 7 days
+1
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

CleanArchitecture.WorkerService

A solution template using Clean Architecture for building a .NET 7.0 Worker Service.

Give a Star! :star:

If you like or are using this project to learn or start your solution, please give it a star. Thanks!

Credits

Big thanks to all of the great contributors to this project!

Build Status

.NET Core

Getting Started

Clone or download the repository.

Install the ef core cli tools dotnet tool install --global dotnet-ef. If you already have an old version, first try dotnet tool update --global dotnet-ef --version 6.0.0-*, if that doesn't work, see Updating Ef Core Cli First, delete C:\Users{yourUser}.dotnet\tools.store\dotnet-ef tool.

This app is currently configured to run against a localdb SQL Server instance. To initialized the database, you will need to run this command in the /src/CleanArchitecture.Worker folder:

dotnet ef database update -c appdbcontext -p ../CleanArchitecture.Infrastructure/CleanArchitecture.Infrastructure.csproj -s CleanArchitecture.Worker.csproj

Check the connection string in appsettings.json in the CleanArchitecture.Worker project to verify its details if you have problems.

Open the solution in Visual Studio and run it with ctrl-F5 (the CleanArchitecture.Worker project should be the startup project) or in the console go to the src/CleanArchitecture.Worker folder and run dotnet run.

On startup the app queues up 10 URLs to hit (google.com) and you should see it make 10 requests and save them to the database and then do nothing, logging each second.

Using this for your own worker service

To use this as a template for your own worker server projects, make the following changes:

  • Rename CleanArchitecture to YourAppName or YourCompany.YourAppName
  • Configure the connection string to your database if you're using one
  • Replace InMemory queue implementations with Azure, AWS, Rabbit, etc. actual queues you're using
  • Remove UrlStatusHistory and related services and interfaces

References

Useful Pluralsight courses:

관련 프로젝트 살펴보기

불러오는 중…