public virtual async Task <RemoteStreamContent> DownloadAsync(Guid id) { var entity = await MediaDescriptorRepository.GetAsync(id); var stream = await MediaContainer.GetAsync(id.ToString()); return(new RemoteStreamContent(stream, entity.Name, entity.MimeType)); }
public virtual async Task DeleteAsync(Guid id) { var mediaDescriptor = await MediaDescriptorRepository.GetAsync(id); var definition = await MediaDescriptorDefinitionStore.GetDefinitionAsync(mediaDescriptor.EntityType); await CheckAnyOfPoliciesAsync(definition.DeletePolicies); await MediaContainer.DeleteAsync(id.ToString()); await MediaDescriptorRepository.DeleteAsync(id); }
public virtual async Task DeleteAsync(Guid id) { var mediaDescriptor = await MediaDescriptorRepository.GetAsync(id); var definition = await MediaDescriptorDefinitionStore.GetAsync(mediaDescriptor.EntityType); /* TODO: Shouldn't DeletePolicies be a dictionary and we check for inputStream.EntityType? */ await CheckAnyOfPoliciesAsync(definition.DeletePolicies); await MediaContainer.DeleteAsync(id.ToString()); await MediaDescriptorRepository.DeleteAsync(id); }