the important thing is not to stop questioning

导航

 

一样写啊...
比如DAL层:

C# code?
1
2
3
4
5
Public void Update(XXXXX.Models.News model)
{
        db.Entry(XXXXX.Models.News).State = EntityState.Modified;
        db.SaveChanges();
}



BLL

C# code?
1
2
3
4
5
Public void Update(XXXXX.Models.News model)
{
///一堆条件.......
    return Update(model);
}



Controllers

C# code?

1
2
3
4
5
6
7
[HttpPost]
Pubic ActionResult(int? id)
{
    var model = db.News.Find(id);
    Update(model);
    return View();
}
posted on 2015-10-15 14:17  qook  阅读(158)  评论(0编辑  收藏  举报