开发者

Modelmetadata for sorting properties?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜