当前位置: 首页>>代码示例>>C#>>正文


C# LoveBankDBContext.Dispose方法代码示例

本文整理汇总了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("操作成功");
     }
 }
开发者ID:gowhy,项目名称:LoveBank,代码行数:11,代码来源:AppVerController.cs

示例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("操作成功");
     }
 }
开发者ID:gowhy,项目名称:LoveBank,代码行数:11,代码来源:LBNoticeController.cs

示例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("操作成功");
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:13,代码来源:AppVerController.cs

示例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();
            }
        }
开发者ID:gowhy,项目名称:MicroWish,代码行数:15,代码来源:AdminController.cs

示例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("操作成功");
            }
        }
开发者ID:gowhy,项目名称:LoveBank,代码行数:22,代码来源:LBNoticeController.cs

示例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);
            }
        }
开发者ID:gowhy,项目名称:MicroWish,代码行数:21,代码来源:AdminController.cs

示例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("操作成功");
            }
        }
开发者ID:gowhy,项目名称:MicroWish,代码行数:17,代码来源:AdminController.cs


注:本文中的LoveBank.Core.MSData.LoveBankDBContext.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。