Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isidro solis #140

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

isidrosolis
Copy link

Description

Creación entidad Provider, creación DTO: ProviderDTO, ProviderSearchDTO, ProviderService. ProviderController.

Issues

Aquí deberías contar si tuviste algún problema o en el caso de que reportaste un issue.

Ej:
Related to #(issue)
Fixes # (issue)

Opinion

Si querés dejar algún comentario al respecto: improvements, mistakes, weaknesses.

@isidrosolis
Copy link
Author

Creación Provider (Class,DTO, Service, Controller).

@isidrosolis isidrosolis reopened this Nov 19, 2021
@isidrosolis
Copy link
Author

Creación de Provider (Class, DTO, Service, Controller).

@GerVeraDev GerVeraDev self-assigned this Nov 23, 2021
var result = service.GetAll();
return mapper.Map<IEnumerable<ProviderDTO>>(result).ToList();
}
catch (Exception)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se podria loggear la Exception

var result = service.Get(id);
return mapper.Map<ProviderDTO>(result);
}
catch (Exception)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se podria loggear la Exception

}
catch (Exception ex)
{
logger.LogCritical(ex.StackTrace);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se podria usar otro metodo del logger que no sea LogCritical.
Segun tu punto de vista, cual podria ser y porque ?

https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger?view=dotnet-plat-ext-6.0

catch (Exception ex)
{
logger.LogCritical(ex.StackTrace);
return Ok(new { Success = false, Message = "The name is already in use" });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aqui, al retornar un "Ok", estas retornando un HTTP status 200 al cliente. Que no seria correcto...

Quizas este articulo te de una pista sobre que retornar ahi.

https://code-maze.com/global-error-handling-aspnetcore/

@GerVeraDev GerVeraDev removed their assignment Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants