public void UnregisterModel(AModel model) { var t = model.GetType(); if (this._register.ContainsKey(t)) { this._register.Remove(t); } else { throw new Exception("Model for type " + t + " not registered."); } }
public void RegisterModel(AModel model) { var t = model.GetType(); if (this._register.ContainsKey(t)) { throw new Exception("Model for type " + t + " already registered."); } else { this._register[t] = model; } }