public virtual async Task <int> DeleteApiScopePropertyAsync(ApiScopePropertiesDto apiScopeProperty) { var propertyEntity = apiScopeProperty.ToEntity(); var deleted = await ApiScopeRepository.DeleteApiScopePropertyAsync(propertyEntity); await AuditEventLogger.LogEventAsync(new ApiScopePropertyDeletedEvent(apiScopeProperty)); return(deleted); }
public virtual async Task <int> AddApiScopePropertyAsync(ApiScopePropertiesDto apiScopeProperties) { var canInsert = await CanInsertApiScopePropertyAsync(apiScopeProperties); if (!canInsert) { await BuildApiScopePropertiesViewModelAsync(apiScopeProperties); throw new UserFriendlyViewException(string.Format(ApiScopeServiceResources.ApiScopePropertyExistsValue().Description, apiScopeProperties.Key), ApiScopeServiceResources.ApiScopePropertyExistsKey().Description, apiScopeProperties); } var apiScopeProperty = apiScopeProperties.ToEntity(); var saved = await ApiScopeRepository.AddApiScopePropertyAsync(apiScopeProperties.ApiScopeId, apiScopeProperty); await AuditEventLogger.LogEventAsync(new ApiScopePropertyAddedEvent(apiScopeProperties)); return(saved); }
public virtual async Task <bool> CanInsertApiScopePropertyAsync(ApiScopePropertiesDto apiResourceProperty) { var resource = apiResourceProperty.ToEntity(); return(await ApiScopeRepository.CanInsertApiScopePropertyAsync(resource)); }