Ejemplo n.º 1
0
        public async Task <IActionResult> PostProperty(int id, [FromBody] IdentityResourcePropertyApiDto identityResourcePropertyApi)
        {
            var identityResourcePropertiesDto = identityResourcePropertyApi.ToIdentityResourceApiModel <IdentityResourcePropertiesDto>();

            identityResourcePropertiesDto.IdentityResourceId = id;

            await _identityResourceService.AddIdentityResourcePropertyAsync(identityResourcePropertiesDto);

            return(Ok());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> AddIdentityProperties(IdentityResourcePropertyDto input)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelStateErrors));
            }
            var result = await _identityResourceService.AddIdentityResourcePropertyAsync(input);

            return(ResultResponse(result, "添加身份资源属性成功"));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> IdentityResourceProperties(IdentityResourcePropertiesDto identityResourceProperty)
        {
            if (!ModelState.IsValid)
            {
                return(Success(identityResourceProperty));
            }

            await _identityResourceService.AddIdentityResourcePropertyAsync(identityResourceProperty);


            return(Success(new { Id = identityResourceProperty.IdentityResourceId }));
        }
        public async Task <IActionResult> IdentityResourceProperties(IdentityResourcePropertiesDto identityResourceProperty)
        {
            if (!ModelState.IsValid)
            {
                return(View(identityResourceProperty));
            }

            await _identityResourceService.AddIdentityResourcePropertyAsync(identityResourceProperty);

            SuccessNotification(string.Format(_localizer["SuccessAddIdentityResourceProperty"], identityResourceProperty.Value, identityResourceProperty.IdentityResourceName), _localizer["SuccessTitle"]);

            return(RedirectToAction(nameof(IdentityResourceProperties), new { Id = identityResourceProperty.IdentityResourceId }));
        }