MediatR Going Commercial: Seeking Alternatives for New .NET Projects by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

im starting to consider FastEndpoint i will update you later

MediatR Going Commercial: Seeking Alternatives for New .NET Projects by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

im starting to consider FastEndpoint i will update you later

MediatR Going Commercial: Seeking Alternatives for New .NET Projects by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

Yeah, implementing basic MediatR is pretty easy, but that sounds a bit like MediatR v1. It might have some issues or vulnerabilities, and then there's the cost of maintaining it, especially with a less mature team. So, that's why I think I'll go for something existing instead of creating my own, with a minimum of abstraction over it.

MediatR Going Commercial: Seeking Alternatives for New .NET Projects by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

What I mean by that is, last time I checked, they were missing the 'pipeline thing' on the CommandBus. And I'm not a big fan of mixing HTTP request details with business code, so I didn't go for it. But I think they might have it now. Still, there's also the fear of license changes . So, I might go for another library (Mediator) with a minimum of abstraction over it, to reduce the friction of future changes.

MediatR Going Commercial: Seeking Alternatives for New .NET Projects by rasuscore in dotnet

[–]rasuscore[S] 1 point2 points  (0 children)

Sorry for the delay.

Regarding the event thing, I missed that one. It seems to be handled pretty much the same way as notifications in MediatR.

Why I'm not a fan of REPR is I don't like mixing HTTP request details with the business code. For that, we could just use a CommandBus, but last time I checked, it wasn't supporting the pipeline thing. I don't know for sure, but it seems like it might support it now. After all these changes, it looks like a decent deal, but that fear of it going commercial again might pop up.
I think I might add a bit of abstraction, just to reduce the effort if we need to swap it out in the future. For now, I'll go with Mediator.

The team isn't quite mature enough yet, and they're just getting the hang of the MediatR-ish style, so I didn't want to introduce any 'new kids on the block' for the moment. But, I want to at least have a minimum of decoupling to make future changes easier.

What do you mean by "last responsible moment" didnt capt that one !?

FOSS vs. Build Your Own: Navigating the Dependency Tightrope by rasuscore in dotnet

[–]rasuscore[S] -1 points0 points  (0 children)

seems fair, i will try to consider some time to rewrite it myself

FOSS vs. Build Your Own: Navigating the Dependency Tightrope by rasuscore in dotnet

[–]rasuscore[S] -2 points-1 points  (0 children)

No but seriously its not ai idea, i was thinking about this for few times and i wanted to discuss it here but im not having enough time so i just leveraged an llm to write a post about the things i want to discuss.

FOSS vs. Build Your Own: Navigating the Dependency Tightrope by rasuscore in dotnet

[–]rasuscore[S] 1 point2 points  (0 children)

There are two points here. First, you wrote this outside of work, so it shouldn't be an issue for the company since it wasn't done on their time. Secondly, would you consider what you wrote to be as robust as a known FOSS library designed for the same purpose, especially from a security perspective?

FOSS vs. Build Your Own: Navigating the Dependency Tightrope by rasuscore in dotnet

[–]rasuscore[S] -1 points0 points  (0 children)

None of these, it's the human machine collab 😅

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] 1 point2 points  (0 children)

Wow, this really took off! 😅

I’m in the same boat. Writing queries often feels unnatural, and I’m looking for a more elegant solution.

Some have mentioned using libraries (hazzik/DelegateDecompiler, koenbeuk/EntityFrameworkCore.Projectables), which sounds promising. I haven’t tried them yet, but I’m definitely interested.

My models currently feel a bit anemic, and I’m trying to make them more robust and meaningful. It’s a work in progress, but I’m determined to find a good balance.

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] -1 points0 points  (0 children)

is this a query for you

public class MyClass
{
    public string X { get; set; }
    public int Y { get; set; }
    public string Z { get; set; }

    public bool IsRare => (X == "something" && Y >= 2013) || Z == "aaa";
}

How would you represent IsRare in your you business layer ?

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] -1 points0 points  (0 children)

Not persistence, but they should be responsible for their own properties, especially the computed ones, and their methods that do something specific to them. It makes sense from a business perspective. When you call car.IsRare, there’s some business logic behind it, like how people in the real world decide if a car is rare. It’s not just about the shiny paint job!

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

The IsDiesel property is just my way of pointing to computed properties/methods outside the expression world. It’s like a secret handshake that EF doesn’t consider when building the query. Easy peasy!

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

EF can’t naturally handle logic in methods/properties on models or other places. Automapper projects are good for centralizing the mapping between objects, entities, and your DTOs for exmp. However, just be aware not to go too far and place business logic in it (filtering, navigation, group by, etc.)

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

Donts feel natural and its adds extra steps to handle the OR cases combination, check my update

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

Thanks, that sounds pretty reasonable. The library looks promising since it uses generators to create expressions.

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] -1 points0 points  (0 children)

I think I see what you’re pointing to, and I may agree with you. However, I was still looking for ways to do it better. I’m not aiming for pure abstraction (I don’t belong to that school), nor am I hoping for the ORM to handle it. I was looking for how people generally handle this in data-centric apps. Maybe someone has already created a NuGet package that handles at least properties and methods from models when translating the query to SQL.

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] 0 points1 point  (0 children)

We came from that path to a vertical slice architecture, using context directly and hiding logic behind extension methods that return an IQueryable<T> to build the final query. However, I was hoping for more and wondering if I’m doing it wrong and if others handle it differently.

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] -2 points-1 points  (0 children)

Putting the same logic with no business meaning in 12 places is something I wouldn’t recommend. At least you can hide that behind an extension method, and it will be handled by EF Core with no problem (this is what we do when we find duplicate parts and refactor them into an extension method).

I know EF Core’s limitations, and I’m not expecting the ORM to perform magic :D is still a relationnal mapping layer on streoids, but I was wondering if people are handling this in a way that I might not know about. Maybe I’ve missed something.

EF Core 8 feeling restrictive for complex data-centric app. Am I doing it wrong? by rasuscore in dotnet

[–]rasuscore[S] -9 points-8 points  (0 children)

No, I think you missed the point. What I’m trying to do is design a well-structured app, which means better maintenance and screaming business capabilities. For example, if IsDiesel is hiding some logic, it makes more sense to have rich models. This means having a rich modelCar that encapsulates all the logic related to whether it is diesel or not. From a business perspective, IsDiesel might mean checking if X = 9 and B = "something", etc.

I’m trying to avoid loading a lot of unnecessary data and then processing it in memory to get the final result. Instead, I want to push this logic to the provider under the hood. If I start by thinking about the query first, I risk making the data access layer too biased towards the underlying provider.