You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MaxLengthAttributeEdmPropertyConvention takes into account MaxLength attribute and sets MaxLength property where appropriate.
I have a number of pattern-attributes like this (only an example):
class ShortLengthStringAttribute : MaxLengthAttribute
{
public ShortLengthString() : base(50)
{
this.ErrorMessage = "Max length is 50 characters";
}
};
class LongLengthStringAttribute : MaxLengthAttribute
{
public LongLengthString() : base(255)
{
this.ErrorMessage = "Max length is 255 characters";
}
};
In this case MaxLengthAttributeEdmPropertyConvention ignores my attributes. Is it possible to allow descendants of MaxLengthAttribute here?
MaxLengthAttributeEdmPropertyConvention takes into account MaxLength attribute and sets MaxLength property where appropriate.
I have a number of pattern-attributes like this (only an example):
In this case MaxLengthAttributeEdmPropertyConvention ignores my attributes. Is it possible to allow descendants of MaxLengthAttribute here?
Assemblies affected
Microsoft.OData.ModelBuilder.dll 2.0.0
Reproduce steps
Make a model with
Expected result
MaxLength should be automatically set to 50 in the model.
Actual result
It is not set
Additional detail
I know there are workarounds. For example I can do it manually. Or I can do something like this:
But I don't think it is natural.
The text was updated successfully, but these errors were encountered: