MVC Action,Service中筛选int 和list<int>

action:

     public ActionResult DeleteByID(int id)
        {
            this.MessageService.DeleteMailTemplate(id);
            var from = Request["from"];
            return RedirectToAction("TemplateIndex", new { from = from });
        }

        public ActionResult DeleteByID(List<int> ids)
        {
            return this.Stop("判断情况是否一致", Request.UrlReferrer.AbsolutePath, true);
        }

 这两个响应会产生报错,


 

而在方法中Service:

 

则是回对两种进行分别的,不会将int看做list<int>型。。(这就跟讲废话一样)

 

不过,action中不进行区分int 和list<int>记住这点就好了。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值