© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago•
7 replies
AlisterKB

Hangfire implementation in Repository pattern

Hi, sorry for newbie question.
I am trying to add hangfire to my project. I believe I am using DDD to the best of my ability
trying to incorporate hangfire and follow DDD architecture i've hit a snag.

here is some code snippet from my hangfire implementation in each layer:
https://paste.mod.gg/ynibbxjvpvfc/0

and below is my project structure:
├───App.Presentation
│ ├───Controllers
│ └───Properties
├───App.Application
│ └───Services
├───App.Domain
│ └───Aggregates (or I believe more commonly people call them entities)
├───App.Infrastructure
│ └───Persistence
│ └───Repositories
└──
I've only installed hangfire related packages in infrustructure layer (Hangfire.AspNetCore & Hangfire.PostgreSql)
due to doing so I only have access to the hangfire methods in infrustructure. now when I wanna use/implement in application layer
RecurringJob.AddOrUpdate(string, Expression<Action>,CRONEXPRESSION)
I pass my JobService a string and I cannot utilize the hangfire method Corn.daily() or other methods provided by hangfire itself.
I really could use your help to know whether I should install hangfire.AspNetCore in application ? and remove it from infrastructure and leave the Hangfire.PostgreSql in infrustructure or what.
really appreciate your kind assistance on this. please let me know if I should provide you with more details.
I would also be very thankful if you could direct me to a code example of hangfire implementation in DDD and Repository pattern.
cheers
BlazeBin - ynibbxjvpvfc
A tool for sharing your source code with the world!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ is Generic Repository a bad implementation of Repository Pattern?
C#CC# / help
4y ago
❔ Repository pattern
C#CC# / help
3y ago
✅ Repository Pattern question.
C#CC# / help
3y ago
hangfire in DDD
C#CC# / help
11mo ago