This question is locked. New answers and comments are not allowed.
Hello I was looking at your samples in the SDK.
In bestpracticewebdevelopmenttwo you have:
Using this method how will the NorthwindContext be disposed?
In bestpracticewebdevelopmenttwo you have:
public
class
ContextFactory
{
public
static
NorthwindContext GetContextPerRequest()
{
HttpContext httpContext = HttpContext.Current;
if
(httpContext ==
null
)
{
return
new
NorthwindContext();
}
else
{
int
contextId = Thread.CurrentContext.ContextID;
int
hashCode = httpContext.GetHashCode();
string
key =
string
.Concat(hashCode, contextId);
NorthwindContext context = httpContext.Items[key]
as
NorthwindContext;
if
(context ==
null
)
{
context =
new
NorthwindContext();
httpContext.Items[key] = context;
}
return
context;
}
}
}
Using this method how will the NorthwindContext be disposed?