Skip to content

SOLIDSoftworks/Solid.Extensions.System.Web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solid.Extensions.System.Web License solidsoftworks MyGet Build Status

Solid.Extensions.System.Web is a library for patching HttpContext.Current to be more async friendly. This library is built for .Net Framework 4.6.1 and above.

Disclaimer

We do not recommended using this library in any new applications. You should always try to have your stack be fully async instead of using Task.Run or any other variation of that within sync methods.

If you are, however, up against the wall and have a sync stack already and need to use async methods, you can try this library out and see if it works for you.

Requirements

This is written for ASP.Net applications. This is not for AspNetCore applications.

How to use

Installation

Just reference the library. When the ASP.Net application starts, it will patch HttpContext.Current for you.

Usage

public string GetString()
{
    HttpContext.Items["Hello"] = "World";
    return HttpContext.Current.Run(() => GetStringAsync());
}

private async Task<string> GetStringAsync()
{
    return $"Hello {HttpContext.Current.Items["Hello"]}";
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages