错误未将操作数字符串应用于int null类型

时间:2015-07-07 09:29:58

标签: asp.net-mvc-4

    public ActionResult update( int? id)
    {
        BusDetailsModel model = new BusDetailsModel();

        using (var ent = new OnlineReservation.AddData.OnlineReservationEntities1())
        {

            var db = ent.BusDetails.FirstOrDefault(x=>x.busId ==id);
            model.BusId = db.busId;
            model.Busname = db.busname;
            model.Busowner = db.busowner;
            model.Bustype = db.busType;
            model.Buscapacity = db.busCapacity;

        }
        return View(model);
    }

0 个答案:

没有答案