Skip to content

Conversation

@slb-bgc-wk
Copy link

No description provided.

@mechcodeman
Copy link

well

  • meet all AC.
  • baby step.
  • meaningful commit message, naming.
  • update request method is very clear.

public async Task<ActionResult<List<ParkingLotEntity>>> GetParkingLotById(string id)
{
var parkingLot = await _parkingLotsService.GetByIdAsync(id);
if (parkingLot == null)

Choose a reason for hiding this comment

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

suggestion: avoid return null from method, since null is hard to understand. here we can throw exception from service

}

[HttpPut("{id}")]
public async Task<ActionResult<ParkingLotEntity>> UpdateCapacityAsync(string id, [FromBody] int capacity)

Choose a reason for hiding this comment

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

suggestion: use class for request body instead of int

var updatedParkingLot = await _parkingLotsService.UpdateCapacity(id, capacity);
if (updatedParkingLot == null)
{
return NotFound();

Choose a reason for hiding this comment

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

suggestion: this can also be handled in global exception handler

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.

3 participants