I have a LanguageMap object that contains a dictionary to map the language code to its value. This object is used in many objects that must have several languages. Therefore, it refers to my data model.
public class LanguageMap
{
public virtual Guid Id { get; set; }
public virtual IDictionary<String, String> Map { get; set; }
public LanguageMap()
{
Map = new Dictionary<string, string>();
}
}
My mapping is as follows:
public class LanguageMapMapping : ClassMap<LanguageMap>
{
public LanguageMapMapping()
{
Id(x => x.Id);
HasMany(x => x.Map)
.Table("LanguageMapMap")
.AsMap<string>("LanguageKey")
.Element("value")
.Cascade.All().Cascade.AllDeleteOrphan();
}
}
In all classes that have the LanguageMap property (for example, public virtual LanguageMap Details{ get; set; }), the mapping for this property is:
References(x => x.Details)
For some reason, this always creates an extra table in the database:

The LanguageMap table is not needed and just adds additional connections for no reason.
Any idea how to fix the mappings?