---
title: "Discussion on \"Creating Worker Service + Entity Framework Core in .NET\" | Hashnode"
description: "Discussion on \"Creating Worker Service + Entity Framework Core in .NET\". A worker service gives some kind of super-power to a console application.\nA worker service in .NET is a console app that runs a long-running task once the application is started, till it's signaled to close.\nIt does not require user interaction.\nIt r..."
url: "https://hashnode.com/posts/creating-worker-service-entity-framework-core-in-net/621513343b018a8cb17c0b5c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Creating Worker Service + Entity Framework Core in .NET](https://ghidyon.hashnode.dev/creating-worker-service-entity-framework-core-in-net?utm_source=hashnode&utm_medium=feed)

A worker service gives some kind of super-power to a console application. A worker service in .NET is a console app that runs a long-running task once the application is started, till it's signaled to close. It does not require user interaction. It r...

Feb 22, 2022 · 6 min read · ghidyon.hashnode.dev  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)
-   [#net](https://hashnode.com/tag/net)
-   [#aspnet-core](https://hashnode.com/tag/aspnet-core)
-   [#aspnet](https://hashnode.com/tag/aspnet)
-   [#net-core](https://hashnode.com/tag/net-core)

## Written by

[Gideon Akunana](https://hashnode.com/@Ghidyon)

@Ghidyon

  
[View profile](https://hashnode.com/@Ghidyon)

Software Developer and NFT Content Writer

Talks about blockchain, NFT, Javascript and C#

## Responses 3

Markdown supported · ⌘↵ to post

[Somanath Sutar](https://hashnode.com/@somanathsutar)

[Jul 21, 2023](https://hashnode.com/posts/creating-worker-service-entity-framework-core-in-net/621513343b018a8cb17c0b5c/comment/64baea03a8381eef4cb8fcad)

How do I write MS unit test for DbHelper.cs? I am unable to mock. In each DbHelper method there is \_dbContext = new AppDbContext(GetAllOptions()) and GetAllOptions is looking for connection string. So overall it doesn't look right for mocking and creating unit test cases. Any example will help.

[Luis Moises Rojas](https://hashnode.com/@lmoisesrojas)

[Jun 14, 2022](https://hashnode.com/posts/creating-worker-service-entity-framework-core-in-net/621513343b018a8cb17c0b5c/comment/62a8b2560baf4306d9493fdf)

Hello, this is an excellent articule, but; this module: CreateDbIfNoneExist(host) can not be called because DOES NOT EXISTS in the context, you call it from Main and it is declared out. Any help?

[Etiene James](https://hashnode.com/@St80ene)

[Feb 22, 2022](https://hashnode.com/posts/creating-worker-service-entity-framework-core-in-net/621513343b018a8cb17c0b5c/comment/62151c7fb35bf58cd4748731)

Great read
