Hi,

when I use  the 'ValidateGroupNotEmpty' attribute on a ActiveRecord
class I get this exception:

 System.NotSupportedException: You must call Build with a type parameter

That's how my attribute looks like:

        [ValidateGroupNotEmpty("ProductOrTeam", "Select Product or Team")]
        [BelongsTo("ProductId",NotNull=false)]
        public Product Product
        {
            get { return product; }
            set { product = value; }
        }


The exception is not thrown when I use it in my model view class that
is not an ActiveRecord class.

Any ideas how I can get ValidateGroupNotEmpty attribute to work on my
ActiveRecord classes as well?

Thanks,
Bogdan Rogalski

error source:
ActiveRecordStarter.Initialize(Assembly.Load("ProductWarehouse.Core"),
ActiveRecordSectionHandler.Instance);

here is the partial stack trace:
[NotSupportedException: You must call Build with a type parameter]
   Castle.Components.Validator.ValidateGroupNotEmptyAttribute.Build() +82
   
Castle.ActiveRecord.Framework.Internal.ActiveRecordModelBuilder.ProcessProperties(Type
type, ActiveRecordModel model) +589
   
Castle.ActiveRecord.Framework.Internal.ActiveRecordModelBuilder.PopulateModel(ActiveRecordModel
model, Type type) +168
   Castle.ActiveRecord.Framework.Internal.ActiveRecordModelBuilder.Create(Type
type) +255
-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.


Reply via email to