public IActionResult AddWorker(WorkerAccountCreationDto workerAccount) { try { WorkerAccount worker = _mapper.Map <WorkerAccount>(workerAccount); worker = _accountsServices.AddWorkerAccount(worker); ; return(CreatedAtRoute("GetWorker", new { id = worker.Id }, worker)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }