There is a problem with Dto's background. Soy new, for favor ayuda :))

I have my Product entity and IProductService in my Domain layer. The problem is that by implementing ProductService in my Application layer, I need to return the DTO that is in Application as well. How do I make the IProductoService method found in Domain return a DTO if it is in the Application layer? This is the ProductService method where I need to return the DTO.
12 Replies
peladodocinero
peladodocinero3mo ago
In this layer: I have the Interface for ProductService
No description
peladodocinero
peladodocinero3mo ago
That returns a Producto. But I want to return a ProductoDto (who is n application leyer)
No description
peladodocinero
peladodocinero3mo ago
And this is the Application Layer
No description
peladodocinero
peladodocinero3mo ago
Obviously generate an error, because that returns a ProductDto
No description
peladodocinero
peladodocinero3mo ago
This is a basic architecture error
Jimmacle
Jimmacle3mo ago
with this architecture you'd need domain models for the service to use and map that to DTOs in the application layer
peladodocinero
peladodocinero3mo ago
but if the service is in the application layer
Jimmacle
Jimmacle3mo ago
but the interface isn't the domain can't know about any higher layers is there a reason you're doing clean architecture? this is one of its flaws, excessive boilerplate consider $vsa
peladodocinero
peladodocinero3mo ago
For practice so the repositoryInterface and service Interface, where do I have to put them?
Jimmacle
Jimmacle3mo ago
¯\_(ツ)_/¯ i don't use this architecture for this exact reason "where do i put this" isn't a question that should take much effort
peladodocinero
peladodocinero3mo ago
:// It's for a tecnical interview
Want results from more Discord servers?
Add your server
More Posts
class errorSo I am trying to identify a class in my .asmx file that is from my .cs file and it keeps erroring, What is the most modern source for CLR internalsThis article from 2005 is cited a lot when discussing .NET CLR internals. Is there a similar point oProblem with Visual Studio not connecting to Google CloudI am trying to connect visual studio and google cloud account to use the API, but when I try to log ✅ Progressbar progression over taskbar icon without nugetI'm trying to find a way to do this with Windows API or something else. I don't want to use nuget pa✅ Writing a source generator for this use caseI have some JSON data I want to load at startup, but image size has become a concern since in the puhow to load the dll for System.Management.Automation on runtime ?```cs using System; using System.Management.Automation; class PowerShhel { public static void Mhow to move json datas to mysqlI have few datas which stored in user_activity.json I need to move them to the mysql and I need to u✅ Is it possible to explicitly state that a method wont modify a mutable class?Assume the following class: ```csharp public sealed class MyTest { public string SomeString { get;Unable to publish WinUI due duplicated WebView2 package from MSIX tooling and nuget packageHello, I am unable to publish my current software due duplicated packages. I do used a workaround in(Maui) Native swipe back on iOShey, i want to implement the native swipe back into my .Net Maui App for iOS. But the only thing i