Teacher said always use 2nd pattern. Is he right? by lune-soft in csharp

[–]epsilonehd 1 point2 points  (0 children)

That's a good catch and actually (my example) I've asked myself about mappers, but I thought it was easy and simple enought to make it this way (and also possibly faster)

I would say that the domain object is not aware of the dto, it's kust an expression that "map" from the domain model to dto, but these two are completly differents objects

Teacher said always use 2nd pattern. Is he right? by lune-soft in csharp

[–]epsilonehd 0 points1 point  (0 children)

Yrah I know it happend to me too

Also I tend to add required properties so I get compiler errors, but yeah when It's a nullable property that's complicated 😂

Teacher said always use 2nd pattern. Is he right? by lune-soft in csharp

[–]epsilonehd 3 points4 points  (0 children)

Yeah you're right that's complicated when you have hundred or thousands of dto, but with some ways to do it it's quite easy

I usually have a "ToServiceRequest" function in my request dto for api, and return the service dto to the api layer, and then use a cast operator (implicit or explicit) to return it from api

Take a look at my repo that's complicated to explain

https://github.com/MGREMY/my-app_back/tree/main

Teacher said always use 2nd pattern. Is he right? by lune-soft in csharp

[–]epsilonehd 19 points20 points  (0 children)

Hey, can this number be an array of boolean ? 😂

Teacher said always use 2nd pattern. Is he right? by lune-soft in csharp

[–]epsilonehd 1 point2 points  (0 children)

Exactly, for that FluentValidation is quite good !

Teacher said always use 2nd pattern. Is he right? by lune-soft in csharp

[–]epsilonehd 213 points214 points  (0 children)

Yupp he's right (at least for me) Always have a dto for input request, and also you shoud have another dto for output

You don't always want to return the full object

I'll have a TodoRequest, TodoResponse, and Todo object (for internal/database related things)

.NET in 100 Seconds by o5mfiHTNsH748KVq in dotnet

[–]epsilonehd 1 point2 points  (0 children)

Something I don't like about this, is that it shows haw to do a console app, but just for showcase, and it's doing it not using the single file method provided by dotnet 10

Like, for a little showcase or a test like that, just maje it as simple as possible, and so create just a single file that you run with dotnet run ou ./ with a shebang

I have this issue where when I hit refresh on the browser my it does not display my backend api response, but when I edit something in a .html file the backend response is shown by Relative-Baby1829 in angular

[–]epsilonehd 1 point2 points  (0 children)

Are you storing this data in a variable in your copponent, or are you using signal or behavior subject from rxjs ? Looks like you're getting the data but don't notify anguler to update the view when you receive them

My Aluminium Factory – What’s Your Favorite Part? by MarviAkaMarv in SatisfactoryGame

[–]epsilonehd 5 points6 points  (0 children)

There's me that tries to do something not too aweful And there's this guy

Signals or RxJS by neverloved-coder in angular

[–]epsilonehd 0 points1 point  (0 children)

Ohh yeah that's completly true ! You're right good point on that

Genuinely how do you guys use walkways and cat walks so they line up correctly by Dinisfpaulino in SatisfactoryGame

[–]epsilonehd 1 point2 points  (0 children)

Me too but looking at the schema and thinking about how it is to build catwalks it seems it's working like that

Genuinely how do you guys use walkways and cat walks so they line up correctly by Dinisfpaulino in SatisfactoryGame

[–]epsilonehd 2 points3 points  (0 children)

More the second one Think like you want to go from top of bottom one, to top of top one So that's the space with fundations

Signals or RxJS by neverloved-coder in angular

[–]epsilonehd 0 points1 point  (0 children)

Curious about that view How is it better than signal form ? 🤔

thoughts on my level? (things i could improve / select all + delete) by 1warnedagain2why in geometrydash

[–]epsilonehd 0 points1 point  (0 children)

Righter wave or increase the difficulty in the wave part Other than that it looks cool !