Beispiel #1
0
 public HttpResourceInfo([NotNull] UriString uri, Stream response, MimeType format)
     : base(uri, ImmutableSession.Empty.Set(Use <IResourceNamespace> .Namespace, x => x.Format, format))
 {
     _response = response;
 }
Beispiel #2
0
 public InMemoryResourceInfo(UriString uri, MimeType format, Stream data, IImmutableSession metadata = default)
     : base(uri, metadata ?? ImmutableSession.Empty.Set(Use <IResourceNamespace> .Namespace, x => x.Format, format))
 {
     _data = data ?? throw new ArgumentNullException(nameof(data));
 }
Beispiel #3
0
 public EmbeddedFileInfo(string uri, MimeType format, Func <Stream> getManifestResourceStream)
     : base(uri, ImmutableSession.Empty.Set(Use <IResourceNamespace> .Namespace, x => x.Format, format))
 {
     _getManifestResourceStream = getManifestResourceStream;
 }
Beispiel #4
0
 public PhysicalFileInfo([NotNull] UriString uri, MimeType format)
     : base(uri, ImmutableSession.Empty.Set(Use <IResourceNamespace> .Namespace, x => x.Format, format))
 {
 }
 public static async Task <IResourceInfo> GetFileAsync(this IResourceProvider resourceProvider, string path, MimeType format, IImmutableSession metadata = default)
 {
     return(await resourceProvider.GetAsync(CreateUri(path), metadata.ThisOrEmpty().Set(Use <IResourceNamespace> .Namespace, x => x.Format, format)));
 }