Is there any w开发者_高级运维ay of setting sort order of my properties with model metadata?
Is this what you are looking for?
As I know there no easy way to do that. You can override model meta data provider with your customized one via deriving from default metadata provider and apply your sorting method.
protected void Application_Start()
{
ModelMetadataProviders.Current = new ConventionMetadataProvider();
ModelValidatorProviders.Current = new ConventionValidatorProvider();
RegisterRoutes(RouteTable.Routes);
}
Here is nice post.
精彩评论