EFIngresProvider/EFIngresStoreVersion.cs
/// <summary>
/// Get the EFIngresStoreVersion from the connection.
/// </summary>
/// <param name="connection">current sql connection</param>
/// <returns>EFIngresStoreVersion corresponding to the current connection</returns>
Get the EFIngresStoreVersion from the connection.
Get the EFIngresStoreVersion from the connection .
public static EFIngresStoreVersion GetStoreVersion(EFIngresConnection connection)
        {
            var match = Regex.Match(connection.ServerVersion, @"II (\w+)\.(\w+)\.(\w+)");
            if (match.Success)
            {
                var serverVersion = new EFIngresStoreVersion(int.Parse(match.Groups[1].Value),
                                                             int.Parse(match.Groups[2].Value),
                                                             int.Parse(match.Groups[3].Value));
                var version = EFIngresStoreVersion.Versions
                                                  .Where(x => x.CompareTo(serverVersion) <= 0)
                                                  .OrderByDescending(x => x)
                                                  .FirstOrDefault();
                if (version != null) { return version; }
            }
            throw new ArgumentException("The version of Ingres [ " + connection.ServerVersion + " ] is not supported via Ingres Entity Framework provider.");
        }
public static EFIngresStoreVersion GetStoreVersion ( EFIngresConnection connection ) { var match = Regex . Match ( connection . ServerVersion , @"II (\w+)\.(\w+)\.(\w+)" ) ; if ( match . Success ) { var serverVersion = new EFIngresStoreVersion ( int . Parse ( match . Groups [ 1 ] . Value ) , int . Parse ( match . Groups [ 2 ] . Value ) , int . Parse ( match . Groups [ 3 ] . Value ) ) ; var version = EFIngresStoreVersion . Versions . Where ( x => x . CompareTo ( serverVersion ) <= 0 ) . OrderByDescending ( x => x ) . FirstOrDefault ( ) ; if ( version != null ) { return version ; } } throw new ArgumentException ( " " + connection . ServerVersion + " " ) ; }
Get the EFIngresStoreVersion from the connection.
Get the EFIngresStoreVersion from the connection .
// IngresConnection.ServerVersion should be something like: "09.02.0001 II 9.2.1 (a64.lnx/103)NPTL"
EFIngresStoreVersion corresponding to the current connection
EFIngresStoreVersion corresponding to the current connection
connection
EFIngresConnection
current sql connection
current sql connection