public async Task <IActionResult> RegisterCustomer([FromBody] BaseCustomerDto customerDto) { switch (customerDto.ApplicationType) { case ApplicationType.MrGreen: await _mediator.Send(CommandMapper.CreateCommand(customerDto as MrGreenCustomerDto)); break; case ApplicationType.RedBet: await _mediator.Send(CommandMapper.CreateCommand(customerDto as RedBetCustomerDto)); break; default: return(BadRequest($"{customerDto.ApplicationType} - Application Type is not supported")); } return(StatusCode((int)HttpStatusCode.Created)); }