Example #1
0
        public async Task <PlayerOutputDto> Create(PlayerInputDto playerInput)
        {
            var player = MappingConfig.Mapper().Map <Player>(playerInput);

            player = await _playersRepository.CreateAsync(player);

            if (player.Employee == null)
            {
                player.Employee = await _employeesRepository.FindAsync(player.EmployeeId);
            }

            return(MappingConfig.Mapper().Map <PlayerOutputDto>(player));
        }