private ManyToOneMapping CreateMapping(PropertyInfo property)
        {
            var mapping = new ManyToOneMapping { PropertyInfo = property };

            mapping.SetDefaultValue(x => x.Name, property.Name);
            mapping.SetDefaultValue(x => x.Class, new TypeReference(property.PropertyType));
            mapping.AddDefaultColumn(new ColumnMapping { Name = property.Name + "_id" });

            return mapping;
        }
Ejemplo n.º 2
0
        private ManyToOneMapping CreateMapping(Member member)
        {
            var mapping = new ManyToOneMapping { Member = member };

            mapping.SetDefaultValue(x => x.Name, member.Name);
            mapping.SetDefaultValue(x => x.Class, new TypeReference(member.PropertyType));
            mapping.AddDefaultColumn(new ColumnMapping { Name = member.Name + "_id" });

            if (member.IsProperty && !member.CanWrite)
                mapping.SetDefaultValue(x => x.Access, cfg.GetAccessStrategyForReadOnlyProperty(member).ToString());

            return mapping;
        }