Castle.MonoRail.ActiveRecordSupport.ARDataBinder.PopInstance C# (CSharp) Method

PopInstance() protected method

protected PopInstance ( object instance, string prefix ) : void
instance object
prefix string
return void
		protected override void PopInstance(object instance, string prefix)
		{
			ActiveRecordModel model = ActiveRecordModel.GetModel(instance.GetType());

			if (model == null && CurrentARModel != null && CurrentARModel.IsNestedType)
			{
				modelStack.Pop();
			}

			if (model != null)
			{
				ActiveRecordModel actualModel = modelStack.Pop();
				
				if (actualModel != model)
				{
					throw new BindingException("Unexpected ARModel on the stack: found {0}, expecting {1}", 
						actualModel.ToString(), model.ToString());
				}
			}

			base.PopInstance(instance, prefix);
		}