DEV Community

Discussion on: Asynchronous Calls, Data-Transfer-Objects & Automapper in .NET Core Web API

Collapse
 
informagico profile image
Alessandro Magoga

Thanks Patric for the great series!

In this chapter I think you're missing to add changes to CharacterController while implementing DTOs.
Parameter type change from Character to AddCharacterDto.

[HttpPost]
public async Task<IActionResult> AddCharacter(AddCharacterDto newCharacter)
{
    return Ok(await _characterService.AddCharacter(newCharacter));
}

or am I missing something?

Collapse
 
_patrickgod profile image
Patrick God

Hey Alessandro,

Thank you very much! You're absolutely right, I totally forgot to add this.
I fixed that now. The change of the types is done right before adding AutoMapper.

Have a great day!

Take care,
Patrick