private async Task BuildIdentityResourcePropertiesViewModelAsync(IdentityResourcePropertiesDto identityResourceProperties) { var propertiesDto = await GetIdentityResourcePropertiesAsync(identityResourceProperties.IdentityResourceId); identityResourceProperties.IdentityResourceProperties.AddRange(propertiesDto.IdentityResourceProperties); identityResourceProperties.TotalCount = propertiesDto.TotalCount; }
public async Task <IActionResult> IdentityResourcePropertyDelete(IdentityResourcePropertiesDto identityResourceProperty) { await _identityResourceService.DeleteIdentityResourcePropertyAsync(identityResourceProperty); return(Success(new { Id = identityResourceProperty.IdentityResourceId })); }
public async Task <IActionResult> IdentityResourcePropertyDelete(IdentityResourcePropertiesDto identityResourceProperty) { await _identityResourceService.DeleteIdentityResourcePropertyAsync(identityResourceProperty); SuccessNotification(_localizer["SuccessDeleteIdentityResourceProperty"], _localizer["SuccessTitle"]); return(RedirectToAction(nameof(IdentityResourceProperties), new { Id = identityResourceProperty.IdentityResourceId })); }
public virtual async Task <int> DeleteIdentityResourcePropertyAsync(IdentityResourcePropertiesDto identityResourceProperty) { var propertyEntity = identityResourceProperty.ToEntity(); var deleted = await IdentityResourceRepository.DeleteIdentityResourcePropertyAsync(propertyEntity); await AuditEventLogger.LogEventAsync(new IdentityResourcePropertyDeletedEvent(identityResourceProperty)); return(deleted); }
public async Task <IActionResult> DeleteProperty(int propertyId) { var identityResourceProperty = new IdentityResourcePropertiesDto { IdentityResourcePropertyId = propertyId }; await _identityResourceService.GetIdentityResourcePropertyAsync(identityResourceProperty.IdentityResourcePropertyId); await _identityResourceService.DeleteIdentityResourcePropertyAsync(identityResourceProperty); return(Ok()); }
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 })); }
public virtual async Task <int> AddIdentityResourcePropertyAsync(IdentityResourcePropertiesDto identityResourceProperties) { var canInsert = await CanInsertIdentityResourcePropertyAsync(identityResourceProperties); if (!canInsert) { await BuildIdentityResourcePropertiesViewModelAsync(identityResourceProperties); throw new UserFriendlyViewException(string.Format(IdentityResourceServiceResources.IdentityResourcePropertyExistsValue().Description, identityResourceProperties.Key), IdentityResourceServiceResources.IdentityResourcePropertyExistsKey().Description, identityResourceProperties); } var identityResourceProperty = identityResourceProperties.ToEntity(); return(await IdentityResourceRepository.AddIdentityResourcePropertyAsync(identityResourceProperties.IdentityResourceId, identityResourceProperty)); }
public IdentityResourcePropertyDeletedEvent(IdentityResourcePropertiesDto identityResourceProperty) { IdentityResourceProperty = identityResourceProperty; }
//-----------------------------------IdentityResourceProperties--------------------------------------------------- public static IdentityResourceProperty ToEntity(this IdentityResourcePropertiesDto identityResourceProperties) { return(Mapper.Map <IdentityResourceProperty>(identityResourceProperties)); }
public IdentityResourcePropertyRequestedEvent(IdentityResourcePropertiesDto identityResourceProperties) { IdentityResourceProperties = identityResourceProperties; }
public virtual async Task <int> DeleteIdentityResourcePropertyAsync(IdentityResourcePropertiesDto identityResourceProperty) { var propertyEntity = identityResourceProperty.ToEntity(); return(await IdentityResourceRepository.DeleteIdentityResourcePropertyAsync(propertyEntity)); }
public virtual async Task <bool> CanInsertIdentityResourcePropertyAsync(IdentityResourcePropertiesDto identityResourcePropertiesDto) { var resource = identityResourcePropertiesDto.ToEntity(); return(await IdentityResourceRepository.CanInsertIdentityResourcePropertyAsync(resource)); }