Thalnos
✅ Help with an Algorithm on time intervals
I was able to solve it. I just seperated the problem into two steps, first building all the intervals, and then checking if there is an entry within an interval. It's maybe not the best optimal solution but it does the job 😊
5 replies
Hangfire implementation in Repository pattern
Aggregates (or I believe more commonly people call them entities)just for clarification, Aggregates does not mean the same thing as entities. Aggregates consist of entities but not every entity is an aggregate or even is part of an aggregate. Say you have an Order entity that consists of items and is made by a customer: Order, OrderItem and Customer are all entities but they're not aggregates. There is only one Aggregate here which is Order and OrderItem. An aggregate defines boundaries for a set of entities in what way you should interact with said entities. Here it means that OrderItem should only be accessed using over the Order entity because thats the Root of the Aggregate. Customer is not part of that aggregate
8 replies
Hangfire implementation in Repository pattern
if my understanding of Clean Architecture that you seemingly try to implement and DDD is correct then your
App.Domain
should not hold such IJobRepository
interface but only Domain Models.
then your Infrastructure
uses domain model object as input for Create, Update and Delete operations instead of values, and it returns domain model/-s on Get methods. This is how you pass values through your layers, they are contained in your model that Infrastructure returns to Application on a Get, or respectively that Application passes to Infrastructure on a Create, Update, Delete. So thats where you get the string from and how you set it.
If you need the hanfire.AspNetCore thing in Application to create the model and pass it a string that you need, so that you can call Create() of your Repostirory then yes I think that's where it belongs.
And doing a quick glance on what hangfire is, a way to perform background processes, that should generally be part of the Application Layer, the Infrastructure Layer would persist those jobs in your Postgres DB and nothing more8 replies
State of caching in EFCore 2025
well if memorycaching is what you need, there is also distributed caching and hybrid caching https://learn.microsoft.com/en-us/aspnet/core/performance/caching/overview?view=aspnetcore-9.0
9 replies
Repository Pattern and Clean Architecture
well I'm doing a projection anyway then to some DTO or ViewModel or whatever, so even if it would be tracking the materialized entity it would be garbagecollected when the obj is out of scope anyway. So you gotta then map back to a domain model on your update, which seems fine
46 replies
Repository Pattern and Clean Architecture
wouldn't that kind of violate the core idea behind an ORM, that each table maps to a class in your code, and each class in your code maps to a table?
In case of inheritance it makes sense if you use Table Per Hierarchy approach then multiple inherited types would be in the same table, but besides that I think thats not a good idea, messes with the simplicity of an ORM.
There seems to be a way to do this https://learn.microsoft.com/en-us/ef/core/modeling/table-splitting#table-splitting
But then I would rather seperate into different DTOs, ViewModels or whatever the context than into different Domain Models and select only what's needed for the mapping tho 🤔
46 replies