コード例 #1
0
 /// <summary>
 /// 创建数据库连接字符串
 /// </summary>
 /// <param name="cp"></param>
 /// <returns></returns>
 public static IDataAccess Create(ConnectionParameter cp)
 {
     if (string.IsNullOrEmpty(cp.ConnectionString))
     {
         throw new ArgumentNullException("ConnectionString is null or empty!");
     }
     return(new DataAccess(cp.ConnectionString, cp.DataBaseType));
 }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cp"></param>
 /// <returns></returns>
 private static IDataAccess CreateDataAccess(ConnectionParameter cp)
 {
     return(new DataAccessProxy(DataAccessProxyFactory.Create(cp)));
 }