public async Task <Repartidor> CreateRepartidor(Repartidor repartidor) { var repartidorEntity = mapper.Map <RepartidorEntity>(repartidor); ARBRepository.CreateRepartidor(repartidorEntity); if (await ARBRepository.SaveChangesAsync()) { return(mapper.Map <Repartidor>(repartidorEntity)); } throw new Exception("there where and error with the DB"); }