I'm going to be fleshing out conventions shortly, a few discussion points if anybody wishes to interject
What conventions should be the Defaults?
- String Properties called EmailAddress
- String Properties called FirstName
- String Properties called LastName
- String Properties called Postcode
- Setting all unrecognised properties to non-null defaults (strings, other objects)
- Tying methods to properties
- Set<PropertyName> maps to PropertyName
- Change<PropertyName> maps to PropertyName
How should convention precedence be worked out?
Consider the following
- Convention to set all strings to sensible defaults
- Convention to set all strings called "Bob" to a special value
I can't guarantee the order in which these conventions will apply, my proposal is to have
And have the IMemberTypeConventionContext only give the type of the member, and the IMemberNameConvention be bound to a type already
Then I'll apply all IMemberTypeConventions and then the IMemberNameConvention<t>
The alternative is a system similar to FNH's, whereby conventions can register 'requirements' against a context
require.Type(x=>x == typeof(string))
And work out a precedence based on which requirements have been added to the context?