lwconquer lwconquer - 9 months ago 34
C# Question

What is a context?

It seems to me that a Context class is a control console that its object can invoke any included functions, such as Datacontext and DoaminContext in WCF Ria service. Do I understand this concept correctly? If so, in what circumstances do I need to create a context class in my own class hierarchy?

Beside DataContext, what other well-known Context classes do the .net framework have?

Answer Source

You can think about the context as a wrapper for related "things" such as HttpContext, DbContext, ObjectContext. i.e.: HttpContext contains any information you can reach for HTTP related operations.

DbContext contains the methods and properties for database communication. Likewise ObjectContext.

I would say it's a placeholder or container of related things for something.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download