public async Task <Guid> CreateAsync(RewardEntity entity)
 {
     if (await _rewardRepository.AddAsync(entity))
     {
         return(entity.Id);
     }
     return(Guid.Empty);
 }
Example #2
0
        //SaveAsyn Method
        public async Task <SaveRewardResponse> SaveAsync(Reward reward)//save data
        {
            try
            {
                await rewardRepository.AddAsync(reward);

                await _unitOfWork.CompleteAsync();

                return(new SaveRewardResponse(reward));
            }
            catch (Exception ex)
            {
                // Do some logging stuff
                return(new SaveRewardResponse($"An error occurred when saving the Service_performance: {ex.Message}"));
            }
        }