views:

15

answers:

0

HI All

I have two entity with in a many-to-many relation.

 public class SecurityGroupMappingOverride : IAutoMappingOverride<SecurityGroup>
{
    public void Override(AutoMapping<SecurityGroup> mapping)
    {
        mapping.HasManyToMany(x => x.Actions).ParentKeyColumn("securityGroupId").ChildKeyColumn("actionId").
            LazyLoad().Table("ActionGroups");

        mapping.HasManyToMany(x => x.Members).ParentKeyColumn("securityGroupId").ChildKeyColumn("userId").
            LazyLoad().Inverse().Table("UserGroups");

        mapping.Map(x => x.Name).Length(64);

    }
}

So I want to create an clustered index on both columns (userId, securityGroupId) from table UserGroups.

Or just to create a Primary Key on UserGroups on them both columns, as at same time could not be two same links.

Thanks

related questions