예제 #1
0
        public async Task Bonus_AddBonusAsync_Return_BonusDto()
        {
            CreateDefaultBonusServiceInstance();
            var bonusDto = _mapper.Map <AddBonusDto>(_fakeBonuseDtos[0]);

            var bonus = await _bonusService.AddBonusAsync(bonusDto, Guid.Empty, default(CancellationToken));

            Assert.NotNull(bonus);
        }
예제 #2
0
 public async Task <ActionResult <ResultDto <BonusDto> > > AddBonusAsync([FromBody] AddBonusDto Bonus)
 {
     return(Ok(await _BonusService.AddBonusAsync(Bonus)));
 }
예제 #3
0
        public async Task <ActionResult <ResultDto <BonusDto> > > AddBonusAsync([FromBody] AddBonusDto Bonus)
        {
            var userId = User.Claims.First(c => c.Type == ClaimTypes.NameIdentifier).Value;

            return(Ok(await _BonusService.AddBonusAsync(Bonus, Guid.Parse(userId))));
        }