Allow mapping columns by convention #219

chilversc opened this Issue Apr 25, 2013 · 3 comments


None yet

2 participants

When mapping an IUserType or an ICompositeUserType by convention there is no ability to specify defaults for the column names.

I would like to be able to do something like

public class DateTimeOffsetConvention : IPropertyConvention, IPropertyConventionAcceptance
    public void Accept (IAcceptanceCriteria<IPropertyInspector> criteria)
        criteria.Expect (x => x.Type == typeof (DateTimeOffset));

    public void Apply (IPropertyInstance instance)
        instance.CustomType<DateTimeOffsetType> ();
        instance.Columns.Add ("Utc");
        instance.Columns.Add ("Offset");

You mean that default column names should be field names?


I meant property names

No, I think the current default strategy is fine, which is to take the names from the IUserType and generate "PropertyName_ColumnName", its just the defaults should be overridable by convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment