Created
February 19, 2011 00:09
-
-
Save pedroreys/834651 to your computer and use it in GitHub Desktop.
Convention needed when database column datatype is Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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