ModelContext模型上下文

摘要:
使用系统;使用System.Collections。通用的使用系统。Linq;使用系统。网状物namespaceTeamService。数据{publicclassModelContextStatus{publicconstantDISABLED=0x0000;publicconstantNORMAL=0x0001;publiccon

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Web;

 

namespaceTeamService.Data

{

    publicclassModelContextStatus

    {

        publicconstintDISABLED=0x0000;

        publicconstintNORMAL=0x0001;

        publicconstintDELETED=0x0004;

    }

    ///<summary>

    /// EntityContext class provides unified access to EF entities

    ///</summary>

    publicclassModelContext

    {

        publicconstintSTATUS_DISABLED=ModelContextStatus.DISABLED;

        publicconstintSTATUS_NORMAL=ModelContextStatus.NORMAL;

        publicconstintSTATUS_DELETED=ModelContextStatus.DELETED;

        publicconstintREMOTE_SERVER=0;

        publicconstintLOCAL_SERVER=1;

 

        privatestaticModelContainermodelContext=null;

 

 

        ///<summary>

        /// Return current entity framework context, if the connection has not open

        /// yet, it will create the connection to database.

        ///</summary>

        publicstaticModelContainerContainer

        {

            get

            {

                if (modelContext==null)

                {

                    modelContext=newModelContainer();

                  

                    if (modelContext.Connection.State!=System.Data.ConnectionState.Open)

                    {

                        modelContext.Connection.Open();

                    }

                }

                returnmodelContext;

            }

        }

    }

}

免责声明:文章转载自《ModelContext模型上下文》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇C++ Opencv 傅里叶变换的代码实现及关键函数详解Modle/View/Delegate框架+QSqlQuery类实现QT和MYSQL交互下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

RTEMS 进程切换分析(基于i386体系)

在支持多任务操作系统中,进程切换是不可避免的,以使进程能在单个CPU上并发执行。进程的调度涉及到的东西较多,例如调度的时机、调度的策略等等,在这里我们只讨论RTEMS任务调度中进程切换的细节,通过分析以明白操作系统如何做到使一个CPU的使用权如何从一个任务上切换到另一个任务。 下面假设两个任务TASK1和TASK2,当前正在执行的任务executing =...

Openssl 之大数运算函数 BN

Openssl 之大数运算函数 BN 主要介绍Openssl中的有关大数运算函数,这个对于RSA研究和实现比较有价值1.初始化函数BIGNUM *BN_new(void); 新生成一个BIGNUM结构void BN_free(BIGNUM *a); 释放一个BIGNUM结构,释放完后a=NULL;void BN_init(BIGNUM *); 初始化所有项...

地图上面加柱状图组

地区地图阴影,加上单点柱状图组的展示 import echarts from 'echarts' import '../../../../map-json/jiangmen' const geoCoordMap = { 市区1: [113.0989, 22.81677], 市区2: [113.200601, 22.672211],...

iOS- CoreData 数据库管理利器!

1.前文                              上次用SQLite3实现了数据管理,这次准备用CoreData来实现。 Core Data 是iOS SDK 里的一个很强大的框架,允许程序员以面向对象的方式储存和管理数据。使用Core Data框架,程序员可以很轻松有效地通过面向对象的接口管理数据 相比SQLite3来说,用CoreDa...

electron 显示对话框 showMessageBoxSync showMessageBox

7.3.2的文档:https://github.com/electron/electron/blob/v7.3.2/docs/api/dialog.md 不同版本可以切换 一个是同步对话框,另外一个是异步。 同步: win.webContents.on('xxx-event', (event) =>{ console.log("==cust_...

Live555 分析(一):类介绍

从程序的结构来看,live项目包括了四个基本库、程序入口类(在mediaServer中)和一些测试代码(在testProgs中)。 四个基本静态库是UsageEnvironment、BasicUsageEnvironment、groupsock和liveMedia。 UsageEnvironment: 包括抽象类UsageEnvironment和抽象类Ta...