Skip to content

Instantly share code, notes, and snippets.

@pedroreys
Created February 19, 2011 00:09
Show Gist options
  • Save pedroreys/834651 to your computer and use it in GitHub Desktop.
Save pedroreys/834651 to your computer and use it in GitHub Desktop.
Convention needed when database column datatype is Image
public class ImageLengthConvention : IPropertyConvention, IPropertyConventionAcceptance
{
public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria)
{
criteria.Expect(x => x.Property.PropertyType == typeof (byte[]));
}
public void Apply(IPropertyInstance instance)
{
instance.Length(2147483647);
instance.CustomSqlType("varbinary(MAX)");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment