/// <summary> /// Gets the list of databases sizes applicable for the specified Azure DB edition (if such /// a mapping exists) as well as the index of the default size for that edition. /// /// Outputs an empty array with an index of -1 if no such mapping exists /// </summary> /// <param name="edition"></param> /// <param name="databaseSizeInfo"></param> /// <returns>TRUE if a mapping exists, FALSE if it does not</returns> public static bool TryGetDatabaseSizeInfo(AzureEdition edition, out KeyValuePair <int, DbSize[]> databaseSizeInfo) { if (AzureEditionDatabaseSizeMappings.TryGetValue(edition, out databaseSizeInfo)) { return(true); } databaseSizeInfo = new KeyValuePair <int, DbSize[]>(-1, new DbSize[0]); return(false); }
/// <summary> /// Gets a KeyValuePair containing a list of the ServiceObjective names mapped to a particular Azure DB Edition /// (if such a mapping exists) as well as the index of the default Service Objective for that edition. /// Outputs an empty array with a default index of -1 if no such mapping exists. /// </summary> /// <param name="edition"></param> /// <param name="serviceObjectiveInfo"></param> /// <returns>TRUE if a mapping exists, FALSE if it did not</returns> public static bool TryGetServiceObjectiveInfo(AzureEdition edition, out KeyValuePair <int, string[]> serviceObjectiveInfo) { if (AzureServiceObjectiveInfo.TryGetValue(edition, out serviceObjectiveInfo)) { return(true); } serviceObjectiveInfo = new KeyValuePair <int, string[]>(-1, new string[0]); return(false); }
/// <summary> /// Gets the default database size for a specified Azure Edition /// </summary> /// <param name="edition"></param> /// <returns>The default size, or NULL if no default exists</returns> public static DbSize GetDatabaseDefaultSize(AzureEdition edition) { DbSize defaultSize = null; KeyValuePair <int, DbSize[]> pair; if (AzureEditionDatabaseSizeMappings.TryGetValue(edition, out pair)) { defaultSize = pair.Value[pair.Key]; } return(defaultSize); }