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

Ejercicio backend Nivel 1 #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DamianIanniruberto95
Copy link

@DamianIanniruberto95 DamianIanniruberto95 commented Nov 23, 2021

Description

Creación de ProviderDTO , ProviderServices , ProviderController ,ProviderSearchDTO ,configuración en el Startup , Unit Testing

Issues

El único inconveniente que se me presentó fue con el método Create donde por adentro evalúa si hay un nombre repetido. Pero lo pude solucionar.

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

Opinion

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

}
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/

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

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