Presently I am converting the hbm.xml files to Code Mapping (Confirmist). I am able to convert everything but I am not sure how to convert the where clause in manyToMany attribute.
<set inverse="true" name="Skills" table="UserPrivileges" mutable="true">
<key>
<column name="UserID" />
</key>
<many-to-many class="School.Campaign.Domain.Skill, School.Campaign.Domain" where="PrivilegeType = 'Skill'">
<column name="PrivilegeID" />
</many-to-many>
</set>
Here when I convert like this :
Set(x => x.Skills, m =>
{
m.Schema("dbo");
m.Table("UserPrivileges");
m.Key(k => k.Column("UserID"));
m.Cascade(Cascade.None);
}, col => col.ManyToMany(m =>
{
m.Columns(x => x.Name("PrivilegeID"));
})
);
But this will not work as the where clause and class type is missing. Can any one please help me out.
You should be able to call
.Where
inside of the.ManyToMany
mapping options: