Пример #1
0
        public async Task <StarsShipDto> Update(StarsShipDto peopleDto)
        {
            var entity = mapper.Map <StarsShip>(peopleDto);
            await starsShipRepository.UpdateAsync(entity, peopleDto.Id);

            await starsShipRepository.SaveAsync();

            var result = mapper.Map <StarsShipDto>(entity);

            return(result);
        }
Пример #2
0
        public async Task <StarsShipDto> Create(StarsShipDto starsShipDto)
        {
            var entity = mapper.Map <StarsShip>(starsShipDto);

            await starsShipRepository.CreateAsync(entity);

            await starsShipRepository.SaveAsync();

            starsShipDto.Id = entity.Id;

            return(starsShipDto);
        }
Пример #3
0
        public async Task <StarsShipDto> Random(int id)
        {
            StarsShipDto result = await starsShipService.Random();

            return(result);
        }
Пример #4
0
        public async Task <StarsShipDto> Update(StarsShipDto starsShipDto)
        {
            StarsShipDto result = await starsShipService.Update(starsShipDto);

            return(result);
        }
Пример #5
0
        public async Task <StarsShipDto> GetById(int id)
        {
            StarsShipDto result = await starsShipService.Get(id);

            return(result);
        }