From d15001bd5bc86a809ee5dd34badad89336bf5682 Mon Sep 17 00:00:00 2001 From: ayende Date: Sat, 10 Mar 2007 11:02:42 +0000 Subject: [PATCH] AR-135: applied patch from Rafael Steil - better error message when using non interface type for an association. git-svn-id: https://svn.castleproject.org/svn/castle/trunk@3583 73e77b4c-caa6-f847-a29a-24ab75ae54b6 --- .../Framework/Internal/Visitors/SemanticVerifierVisitor.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ActiveRecord/Castle.ActiveRecord/Framework/Internal/Visitors/SemanticVerifierVisitor.cs b/ActiveRecord/Castle.ActiveRecord/Framework/Internal/Visitors/SemanticVerifierVisitor.cs index 1f317f855..bc1b59c11 100644 --- a/ActiveRecord/Castle.ActiveRecord/Framework/Internal/Visitors/SemanticVerifierVisitor.cs +++ b/ActiveRecord/Castle.ActiveRecord/Framework/Internal/Visitors/SemanticVerifierVisitor.cs @@ -722,6 +722,14 @@ namespace Castle.ActiveRecord.Framework.Internal if (type != RelationType.Guess) return type; Type propertyType = property.PropertyType; + + if (!propertyType.IsInterface) + { + throw new ActiveRecordException(String.Format( + "Type of property {0}.{1} must be an interface (IList, ISet, IDictionary or their generic counter parts). You cannot use ArrayList or List as the property type.", + property.DeclaringType.Name, property.Name)); + } + if (propertyType == typeof(IList)) { return RelationType.Bag; @@ -849,4 +857,4 @@ namespace Castle.ActiveRecord.Framework.Internal } #endif } -} \ No newline at end of file +} -- 2.11.4.GIT