/// <summary> /// Initializes a new instance of the <see cref="DataContext"/> class. /// </summary> public DataContext() { this.model = new ModelContainer(); this.model.Configuration.ProxyCreationEnabled = false; this.AccountManager = new AccountManager(this.model); this.PlayerManager = new PlayerManager(this.model); }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (this.model != null) { this.model.SaveChanges(); this.model.Dispose(); this.model = null; } }