Skip to content
New issue

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

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

Already on GitHub? # to your account

Pull Request de Adrián De Simone #135

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

Conversation

adriandesimone
Copy link

Description

Actividad inicial realizada. Los test corrieron de forma satisfactoria

@gerardoaquino25
Copy link
Collaborator

Buenas! Te dejo algunas preguntas y sugerencias:

  • Manejo de respuesta: ante errores controlados en algunos maneja un mensaje de respuesta 200 con un mensaje, en otros se arroja un llano 500 sin loguear. En caso de un request exitoso, a veces se devuelve un objecto con propiedades (Success, Message) y otras nada.
    Cual te parece la forma más adecuada en general? Sugerencia
  • "this": a veces se usa y otra no. Ves alguna forma de reducir los ya existentes con algún criterio? Pista.

Dejo también algunos comentarios en las líneas de código especificas.
Para todos las sugerencias, usa el código ya existente como guía pero no te limites a pensar que no se puede mejorar!
Saludos!

/// </summary>
/// <param name="name">Provider name to check.</param>
/// <returns></returns>
private bool NombreUnico(string name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Esta funcion es identica a la que esta en la clase StoreService. Se te ocurre alguna forma de refactorizar el codigo para evitar duplicacion?

/// <param name="id">Provider id.</param>
/// <param name="value">Provider information.</param>
[HttpPut("{id}")]
public void Put(string id, [FromBody] ProviderDTO value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Que pasa si el parámetro id es distinto al del id contenido dentro del parámetro value?

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

¿Por qué se usa critical? ¿Por qué el mensaje de la respuesta es que ya existe si esta en un catch general?

/// <param name="value">Provider info.</param>
/// <returns></returns>
[HttpPost]
public ActionResult Post([FromBody] ProviderDTO value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cual es la diferencia entre usar como respuesta un ActionResult, ActionResult<ProviderDTO> y ProviderDTO? Cual te parece más adecuado?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants