protected virtual async Task <DatabaseFileContainer> GetOrCreateContainerAsync( string name, CancellationToken cancellationToken = default) { var container = await DatabaseFileContainerRepository.FindAsync(name, cancellationToken); if (container != null) { return(container); } container = new DatabaseFileContainer(GuidGenerator.Create(), name, CurrentTenant.Id); await DatabaseFileContainerRepository.InsertAsync(container, cancellationToken : cancellationToken); return(container); }
protected virtual string BuildAccessUrl(DatabaseFileContainer container, string fileId) { var accessUrl = container.IncludeContainer ? $"{container.HttpServer.TrimEnd('/')}/{container.Name}/{fileId}" : $"{container.HttpServer.TrimEnd('/')}/{fileId}"; return(accessUrl); }