public virtual async Task <int> DeleteApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperty) { var propertyEntity = apiResourceProperty.ToEntity(); var deleted = await ApiResourceRepository.DeleteApiResourcePropertyAsync(propertyEntity); return(deleted); }
public virtual async Task <int> DeleteApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperty) { var propertyEntity = apiResourceProperty.ToEntity(); var deleted = await ApiResourceRepository.DeleteApiResourcePropertyAsync(propertyEntity); await AuditEventLogger.LogEventAsync(new ApiResourcePropertyDeletedEvent(apiResourceProperty)); return(deleted); }
public virtual async Task <int> AddApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperties) { var canInsert = await CanInsertApiResourcePropertyAsync(apiResourceProperties); if (!canInsert) { await BuildApiResourcePropertiesViewModelAsync(apiResourceProperties); throw new UserFriendlyViewException(string.Format(ApiResourceServiceResources.ApiResourcePropertyExistsValue().Description, apiResourceProperties.Key), ApiResourceServiceResources.ApiResourcePropertyExistsKey().Description, apiResourceProperties); } var apiResourceProperty = apiResourceProperties.ToEntity(); return(await ApiResourceRepository.AddApiResourcePropertyAsync(apiResourceProperties.ApiResourceId, apiResourceProperty)); }
public virtual async Task <bool> CanInsertApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperty) { var resource = apiResourceProperty.ToEntity(); return(await ApiResourceRepository.CanInsertApiResourcePropertyAsync(resource)); }
public async Task <int> DeleteApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperty) { var propertyEntity = apiResourceProperty.ToEntity(); return(await _apiResourceRepository.DeleteApiResourcePropertyAsync(propertyEntity)); }