Hi,
On your property definitions you have both UniqueKey and Unique
constraints. This means that in addition to the multi-property
constraint on the combined value that you want you also have a
separate unique constraint on each individual column, and is is this
that is throwing the exception on your first column.
What you want is
[Property(UniqueKey="MY_KEY")]
public string PropertyA { get; set; }
[Property(UniqueKey="MY_KEY")]
public string PropertyB { get; set; }
Dave.
On Jun 27, 12:25 am, TrentCioran <[email protected]> wrote:
> Hi,
>
> Is there a form to specify a multi-property constraint?
>
> I'd tried with the same value in UniqueKey for two properties but
> don't work, say i have the next object
>
> public class MyEntity
> {
>
> [Property(UniqueKey="MY_KEY", Unique=true)]
> public string PropertyA { get; set; }
>
> [Property(UniqueKey="MY_KEY", Unique=true)]
> public string PropertyB { get; set; }
>
> .... more properties
>
> }
>
> but it trhows an exception when i'd tried to save an object, say i
> have [new MyEntity { PropertyA = "aValue", PropertyB =
> "anotherValue" } ] this saves fine, but if i try to save [new
> MyEntity { PropertyA = "aValue", PropertyB = "okAnother" } ] it throws
> an exception argumenting that the value already exist (PropertyA =
> "aValue").
>
> Can someone help me with this?
>
> Thanks
>
> P.S. sorry for my english =P
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---