예제 #1
0
파일: IModelRegister.cs 프로젝트: X0R0X/mvc
        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.");
            }
        }
예제 #2
0
파일: IModelRegister.cs 프로젝트: X0R0X/mvc
        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;
            }
        }