public void Dispose() { if (db != null) { db.Dispose(); db = null; } }
public PYTService() { db = new Data.MDDbContext(); //注册该类下用到的数据库映射 db.AddEntityRegister(new Data.Mapping.DialogueMap()); db.AddEntityRegister(new Data.Mapping.JoinMap()); db.AddEntityRegister(new Data.Mapping.NoticeMap()); db.AddEntityRegister(new Data.Mapping.PublishMap()); db.AddEntityRegister(new Data.Mapping.UserMap()); }