CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

FNH Component Mapping

260 Views
Copy Code Show/Hide Line Numbers
public class ComponentPropertyConvention : IPropertyConvention, IPropertyConventionAcceptance
{
    public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria)
    {
        criteria.Expect(x => x.EntityType.IsAny(typeof (IndividualInfo), typeof (CompanyInfo), typeof (Address)));
    }
 
    public void Apply(IPropertyInstance instance)
    {
        var name = string.Format("{0}_{1}", instance.EntityType.Name, instance.Property.Name);
        instance.Column(name);
    }           
}
by David R. Longnecker
  August 19, 2009 @ 7:48pm
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate