Exemplo n.º 1
0
        public async Task SyncLoyaltyTable(CreateOrUpdateLoyaltyViewModel model, string accessToken)
        {
            var baseUrl = AppSettingsProvider.LoyaltyBaseUrl;

            var api = AppSettingsProvider.CreateOrUpdateLoyalty;

            var messageBody = JsonConvert.SerializeObject(model);
            var result      = await _httpHandler.AuthPostAsync <CreateOrUpdateLoyaltyViewModel>(accessToken, baseUrl, api, messageBody);
        }
Exemplo n.º 2
0
        private async Task SyncLoyaltyTable(bool isCreate, ApplicationUser localUser, string accessToken)
        {
            CreateOrUpdateLoyaltyViewModel createOrUpdateLoyaltyViewModel;

            if (isCreate)
            {
                createOrUpdateLoyaltyViewModel = new CreateOrUpdateLoyaltyViewModel()
                {
                    UserId = localUser.Id,
                    Credit = 50,
                    Score  = 0,
                    Win    = 0
                };
                await _loyaltySyncService.SyncLoyaltyTable(createOrUpdateLoyaltyViewModel, accessToken);
            }
        }