class-level Context, not ideal?

Jun 11, 2009 at 2:38 PM

 

I noticed that you have a class-level Context.

I thought that, in general, this was not recommended.

Can you speak to the issue?

 

Here is a sample of what I am talking about in this question..

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NerdDinner.Models {

    public class DinnerRepository : NerdDinner.Models.IDinnerRepository {

        NerdDinnerDataContext db = new NerdDinnerDataContext();

...

 

Thank you.

-- Mark Kamoski