本文整理汇总了C#中LoveBank.Core.MSData.LoveBankDBContext.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# LoveBankDBContext.Dispose方法的具体用法?C# LoveBankDBContext.Dispose怎么用?C# LoveBankDBContext.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoveBank.Core.MSData.LoveBankDBContext
的用法示例。
在下文中一共展示了LoveBankDBContext.Dispose方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
public ActionResult Delete(int id)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
AppVer img = db.T_AppVer.Find(id);
db.Delete<AppVer>(img);
db.SaveChanges();
db.Dispose();
return Success("操作成功");
}
}
示例2: Delete
public ActionResult Delete(int id)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
Notice notice = db.T_Notice.Find(id);
db.Delete<Notice>(notice);
db.SaveChanges();
db.Dispose();
return Success("操作成功");
}
}
示例3: ChangeStateAdImg
public ActionResult ChangeStateAdImg(int id, int state)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
AppVer img = db.T_AppVer.Find(id);
img.State = state;
db.Update<AppVer>(img);
db.SaveChanges();
db.Dispose();
return Success("操作成功");
}
}
示例4: Add
public ActionResult Add()
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
IList<Role> role = db.T_Role.AsQueryable<Role>().ToList();
ViewData["UserRole"] = role;
//部门组织
var list = db.T_Department.AsQueryable<Department>().Where(x => x.Level <= 6).ToList();
ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);
db.Dispose();
return PartialView();
}
}
示例5: PushMsg
/// <summary>
/// App推送消息标识
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public ActionResult PushMsg(int id)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
Notice notice = db.T_Notice.Find(id);
if (notice.State >= 1)
{
return Json("已经推送,不能再推送");
}
notice.State = 1;
db.Update<Notice>(notice);
db.SaveChanges();
db.Dispose();
return Json("操作成功");
}
}
示例6: Edit
public ActionResult Edit(int id)
{
using (LoveBankDBContext db = new LoveBankDBContext())
{
AdminUser user = db.T_AdminUser.Find(id);
List<Role> role = db.T_Role.AsQueryable<Role>().ToList();
ViewData["UserRole"] = role;
//部门组织
var list = db.T_Department.AsQueryable<Department>().Where(x => x.Level <= 6).ToList();
if (list != null)
{
ViewData["Department_List"] = HelpSerializer.JSONSerialize<List<Department>>(list);
}
db.Dispose();
return PartialView(user);
}
}
示例7: PostAdd
public ActionResult PostAdd(AdminUser model)
{
model.LoginTime = DateTime.Now;
model.LoginIP =Utility.GetIP();
using (LoveBankDBContext db = new LoveBankDBContext())
{
if (db.T_AdminUser.Count(u => u.UserName.Trim() == model.UserName.Trim()) > 0)
{
db.Dispose();
return Error("用户已经存在");
}
db.T_AdminUser.Add(model);
db.SaveChanges();
return Success("操作成功");
}
}