The exception & call stack ?

2009/4/24 bdaniel7 <[email protected]>

>
> By Ayende's suggestion, i post this too (also posted in Castle Project
> group)
>
> I have this situation:
> class Order
> {
>                [HasMany( Inverse=true,
> Cascade=ManyRelationCascadeEnum.SaveUpdate)]
>                public virtual IList< OrderItem > Items
>                {
>                        get { return items; }
>                        set { items = value; }
>                }
>
> }
>
> class OrderItem
> {
>                [BelongsTo( "[Order]" )]
>                public virtual Order Order
>                {
>                        get { return order; }
>                        set { order = value; }
>                }
>
>                [Any( typeof ( int ), MetaType = typeof
> ( ProductType ), TypeColumn
> = "ProductType", IdColumn = "ProductID" )]
>                [Any.MetaValueAttribute( "0", typeof ( Color ) )]
>                [Any.MetaValueAttribute( "1", typeof
> ( VerandaSize ) )]
>                [Any.MetaValueAttribute( "2", typeof ( RoofPlate ) )]
>                [Any.MetaValueAttribute( "3", typeof ( Pillar ) )]
>                [Any.MetaValueAttribute( "4", typeof ( SideFrame ) )]
>                [Any.MetaValueAttribute( "5", typeof ( WindScreen ) )]
>                public virtual IPricedModel Product
>                {
>                        get { return product; }
>                        set { product = value; }
>                }
>
> }
>
> Because there are multiple products that share some properties, I
> picked this approach.
> Now, when I try to save an Order, with several OrderItems, I receive
> this errror:
> "Invalid index 5 for this SqlParameterCollection with Count=5"
> The log makes me think that this occurs when trying to save the
> OrderItem.
> In debugger, all OrderItems that I'm saving have all the data
> required.
>
> Can someone tell me to why is this happening?
> Thanks,
> Dan
>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to