peladodocinero
peladodocinero
CC#
Created by peladodocinero on 3/27/2024 in #help
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.
21 replies
CC#
Created by peladodocinero on 1/3/2024 in #help
The best way to handle Errors in Clean Arch
Hello, everything okay? I have a question. I want to know what is the best way to handle errors in my application using Clean Architecture. To put you in context, I am creating a layered API, that is, there is the Infrastructure that contains the repository and the application layer that contains the service. The logic goes in the service, for example, when a user registers and their username has at least 6 characters, then it throws an error that is ArgumentException with a message:
throw new ArgumentException("The Password must be at least 6 characters");
throw new ArgumentException("The Password must be at least 6 characters");
Now, in the controller, what is the best way to handle those errors? Why does it always return a status code of 500, while the error could be 401? Also, how do I resolve the message? Thank you so much. I leave you images so that you can put yourself in context.
44 replies
CC#
Created by peladodocinero on 1/3/2024 in #help
error MSB4006: A circular dependency exists in the target dependency graph in which the destination
No description
10 replies
CC#
Created by peladodocinero on 10/20/2023 in #help
❔ Filter .NET error from beginner
No description
7 replies
CC#
Created by peladodocinero on 1/9/2023 in #help
❔ CSharp [] attribute help
Hi! sorry for the basic question, but I need a not so technical and more casual explanation about (I think it is) the call of attributes through brackets [] Like this code:
[ApiController]// What is this? What attribute does he call? where from?
[Route("[controller]")]

public class WeatherForecastController : ControllerBase
{
[ApiController]// What is this? What attribute does he call? where from?
[Route("[controller]")]

public class WeatherForecastController : ControllerBase
{
8 replies