コード例 #1
0
        public async Task ProcessRequest(IDotvvmRequestContext context)
        {
            var id = Convert.ToInt32(context.Parameters["Id"]);

            var bytes = facade.GetImage(id);

            context.HttpContext.Response.ContentType = "image/jpeg";
            await context.HttpContext.Response.Body.WriteAsync(bytes, 0, bytes.Length);
        }
コード例 #2
0
        public Task ProcessRequest(IDotvvmRequestContext context)
        {
            var id = Convert.ToInt32(context.Parameters["Id"]);

            var bytes = facade.GetImage(id);

            context.HttpContext.Response.ContentType = "image/jpeg";
            context.HttpContext.Response.Body.Write(bytes, 78, bytes.Length - 78);      // cut off the OLE header

            return(Task.CompletedTask);
        }