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);
}