uniquekey is a csv.

On Tue, Apr 19, 2011 at 8:43 AM, Luka <[email protected]> wrote:

> Hi,
> I have this scenario:
>
> public class User: Entity
> {
>    public virtual string Username {get;set;}
>    public virtual string Password{get;set;}
>    public virtual Tenant Tenant {get;set;}
> ...
> }
>
> public class Tenant: Entity
> {
> ...
> }
>
> and mapping like this:
>  mapper.Class<User>(map=>
>                               {
>                                   map.Property(x => x.Username, m =>
>                                                                 {
>
> m.Column(
>
> cm =>
>
> {
>
> cm.UniqueKey("usernamePassword_unique");
>
> cm.UniqueKey("username_tennant_unique");
>                                                                         });
>
> m.Index("username_indx");
>
> m.Length(20);
>                                                                 });
>                                   map.Property(x => x.PasswordHash, m
> =>
>                                                                     {
>
> m.Column(
>
> cm =>
>
> cm.UniqueKey("usernamePassword_unique"));
>
> m.Length(50);
>                                                                     });
>                                   map.ManyToOne(x => x.Tenant, m =>
> m.Column(cm => cm.UniqueKey("username_tennant_unique")));
>                               });
>
> What I want is to define two composite unique constraints (indexes):
> 1. Between Username and password
> 2. Between Username and TennatId
>
> The problem is that the last UniqueKey() for username overrides the
> first one, allowing me to have only one.
>
> How to map this scenarion?
>
> Thanks
>
> --
> 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.
>
>


-- 
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