我在使用新的 Loquacious 配置映射到 IDictionary 时遇到问题。
这是课程:
public class Person
{
public Person()
{
Description = new Dictionary<int, string>();
}
public virtual int Id { get; set; }
// can be in various languages
public virtual IDictionary<int, string> Resources { get; set; }
}
public class PersonResource
{
public virtual string Description { get; set; }
}
这是映射:
public class TestPersonMap : ClassMapping<TestPerson>
{
Table("TestPersons");
Id(c => c.Id, m => m.Generator(Generators.HighLow, gm => gm.Params(new { max_low = 1000 })));
Map(c => c.Resources, mpm =>
{
mpm.Table("TestPersonResources");
mpm.Key(km => km.Column("Id"));
},
mkr => mkr.Component(cem => cem.Property(p => p.Description)));
这会在数据库中生成一个表,如下所示:
TestPersons
-----------
Id
TestPersonResources
-------------------
Id
Description
idx
问题是,如何将 TestPersonResources 表中的 'idx' 列的名称更改为 Lcid?
但我似乎无法将其应用于我的问题。
提前致谢!