private PropertyMapping GetPropertyMapping(Type type, PropertyInfo property, ComponentMapping component) { var mapping = new PropertyMapping { ContainingEntityType = type, PropertyInfo = property }; var columnName = property.Name; if (component != null) columnName = expressions.GetComponentColumnPrefix(component.PropertyInfo) + columnName; mapping.AddDefaultColumn(new ColumnMapping { Name = columnName }); if (!mapping.IsSpecified(x => x.Name)) mapping.Name = mapping.PropertyInfo.Name; if (!mapping.IsSpecified(x => x.Type)) mapping.SetDefaultValue(x => x.Type, new TypeReference(mapping.PropertyInfo.PropertyType)); return mapping; }
private PropertyMapping GetPropertyMapping(Type type, Member property) { var mapping = new PropertyMapping { ContainingEntityType = type, Member = property }; mapping.AddDefaultColumn(new ColumnMapping { Name = property.Name }); if (!mapping.IsSpecified("Name")) mapping.Name = mapping.Member.Name; if (!mapping.IsSpecified("Type")) mapping.SetDefaultValue("Type", GetDefaultType(property)); return mapping; }
private PropertyMapping GetPropertyMapping(Type type, Member property, ComponentMapping component) { var mapping = new PropertyMapping { ContainingEntityType = type, Member = property }; var columnName = property.Name; if (component != null) columnName = cfg.GetComponentColumnPrefix(component.Member) + columnName; mapping.AddDefaultColumn(new ColumnMapping { Name = columnName }); if (!mapping.IsSpecified("Name")) mapping.Name = mapping.Member.Name; if (!mapping.IsSpecified("Type")) mapping.SetDefaultValue("Type", GetDefaultType(property)); return mapping; }