日期:2014-05-17 浏览次数:20416 次
public class Toka { private MyContext db = new MyContext(); public string a { set; get; } public void Create() { db.Tokas.Add(this); } ~Toka() { db.Dispose(); }
protected MyContext db = new MyContext (); protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); }
------解决方案--------------------