protected override void WriteResponse(DashboardResponse response) { foreach (var resourceName in _resourceNames) WriteResource( response, _assembly, $"{_baseNamespace}.{resourceName}"); }
protected override async Task WriteResponse(DashboardResponse response) { foreach (var resourceName in _resourceNames) { await WriteResource( response, _assembly, $"{_baseNamespace}.{resourceName}"); } }
protected async Task WriteResource(DashboardResponse response, Assembly assembly, string resourceName) { using (var inputStream = assembly.GetManifestResourceStream(resourceName)) { if (inputStream == null) { throw new ArgumentException( $@"Resource with name {resourceName} not found in assembly {assembly}."); } await inputStream.CopyToAsync(response.Body); } }
protected virtual Task WriteResponse(DashboardResponse response) { return(WriteResource(response, _assembly, _resourceName)); }
protected virtual void WriteResponse(DashboardResponse response) { WriteResource(response, _assembly, _resourceName); }