会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
plina
博客园
::
首页
::
博问
::
闪存
::
新随笔
::
联系
::
订阅
::
管理
::
公告
2016年11月10日
扩展AuthorizeAttribute
摘要: MVC中经常会用到关于设置访问权限的问题: 如果我们扩展了AuthorizeAttribute,那么我们只需要在类或方法前加上此attribute,即可实现权限问题。 AttributeTargets 权限适用于类或者方法
阅读全文
posted @ 2016-11-10 17:20 plina
阅读(401)
评论(0)
推荐(0)
扩展ValidationAttribute 1
摘要: MVC中经常会用一些服务端对Model的验证。 服务端验证要继承自ValidationAttribute,并重写IsValid虚方法来自定义自己的验证规则。 比如上边校验字符串不能少于指定字符,否则show出来用户自定义的message。
阅读全文
posted @ 2016-11-10 17:09 plina
阅读(661)
评论(0)
推荐(0)
动态linq to list排序
摘要: public class QeurySort { public static IList Sort(IList list,string sidx,string sord) { switch (sord) { case "asc": ret...
阅读全文
posted @ 2016-11-10 14:41 plina
阅读(437)
评论(0)
推荐(0)