Beispiel #1
0
        public ResponseDto AddConsent(ConsentDto consent)
        {
            ResponseDto response = new ResponseDto();

            response.Message = $"You've added a Consent with Value: '{consent?.Value}' and Desc: '{consent.Description}'!";
            response.IsOk    = true;

            return(response);
        }
    /// <inheritdoc />
    protected override void PersistNewItem(IConsent entity)
    {
        entity.AddingEntity();

        ConsentDto dto = ConsentFactory.BuildDto(entity);

        Database.Insert(dto);
        entity.Id = dto.Id;
        entity.ResetDirtyProperties();
    }
    /// <inheritdoc />
    protected override void PersistUpdatedItem(IConsent entity)
    {
        entity.UpdatingEntity();

        ConsentDto dto = ConsentFactory.BuildDto(entity);

        Database.Update(dto);
        entity.ResetDirtyProperties();

        IsolatedCache.Clear(RepositoryCacheKeys.GetKey <IConsent, int>(entity.Id));
    }
Beispiel #4
0
        public async Task <IActionResult> Index(ConsentDto model, string returnUrl)
        {
            var request = await _interaction.GetAuthorizationContextAsync(returnUrl);

            ConsentResponse response = new ConsentResponse()
            {
                RememberConsent = true,
                ScopesConsented = request.ScopesRequested
            };
            await _interaction.GrantConsentAsync(request, response);

            return(Redirect(returnUrl));
        }
Beispiel #5
0
        public void AddOrUpdateConsent(ConsentDto consentDto)
        {
            var consent = MappingService.Map <Consent>(consentDto);

            OAuthUowFactory.AddOrUpdateConsent(consent);
        }