zoukankan      html  css  js  c++  java
  • dbml 连接

        public class WorkflowDataService
        {
            private const string WORKFLOW_ACTION_CONNECTION_STRING = "WorkflowActionConnection";
    
            internal static WorkflowActionDataContext NewActionDataContext()
            {
                return NewActionDataContext(null);
            }
    
            internal static WorkflowActionDataContext NewActionDataContext(IDbConnection connection)
            {
                return NewActionDataContext(connection, true);
            }
            /// <summary>
            /// Gets the new database.
            /// </summary>
            /// <param name="objectTrackingEnabled">if set to <c>true</c> [object tracking enabled].</param>
            /// <returns></returns>
            internal static WorkflowActionDataContext NewActionDataContext(IDbConnection connection, bool objectTrackingEnabled)
            {
                WorkflowActionDataContext context = null;
    
                if (connection == null)
                {
                    context = new WorkflowActionDataContext(
                        ConfigurationManager.ConnectionStrings[WORKFLOW_ACTION_CONNECTION_STRING].ConnectionString
                        );
                }
                else
                {
                    context = new WorkflowActionDataContext(connection);
                }
    
                if (null == context)
                {
                    throw new DataContextException { DataContextType = typeof(WorkflowActionDataContext) };
                }
                else
                {
                    context.ObjectTrackingEnabled = objectTrackingEnabled;
                }
                return context;
            }
        }
  • 相关阅读:
    koa2环境搭建
    单例模式
    nodejs fs path
    path node
    webpack code splitting
    babel 插件编写
    C#验证码类
    C#身份证识别相关技术
    C# Socket服务端与客户端通信(包含大文件的断点传输)
    动态抓取网页信息
  • 原文地址:https://www.cnblogs.com/chinaniit/p/1501892.html
Copyright © 2011-2022 走看看