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

ShouldRecreateInstance() protected method

protected ShouldRecreateInstance ( object value, Type type, string prefix, Castle.Components.Binder.Node node ) : bool
value object
type System.Type
prefix string
node Castle.Components.Binder.Node
return bool
		protected override bool ShouldRecreateInstance(object value, Type type, string prefix, Node node)
		{
			if (IsContainerType(type))
			{
				return true;
			}

			if (node != null && CurrentARModel != null)
			{
				// If it's a belongsTo ref, we need to recreate it 
				// instead of overwrite its properties, otherwise NHibernate will complain
				if (IsBelongsToRef(CurrentARModel, prefix))
				{
					return true;
				}
			}

			return base.ShouldRecreateInstance(value, type, prefix, node);
		}