/// <summary> /// Gets the <see cref="Version"/> of the current Subtext data store (ie. SQL Server). /// This is the value stored in the database. If it does not match the actual /// assembly version, we may need to run an upgrade. /// </summary> /// <returns></returns> public Version GetCurrentInstallationVersion() { var procedures = new StoredProcedures(_connectionString); try { using(var reader = procedures.VersionGetCurrent()) { if(reader.Read()) { var version = new Version((int)reader["Major"], (int)reader["Minor"], (int)reader["Build"]); reader.Close(); return version; } } } catch(SqlException exception) { if(exception.Number != (int)SqlErrorMessage.CouldNotFindStoredProcedure) { throw; } } return null; }
/// <summary> /// Updates the value of the current installed version within the subtext_Version table. /// </summary> /// <param name="newVersion">New version.</param> /// <param name="transaction">The transaction to perform this action within.</param> public static void UpdateInstallationVersionNumber(Version newVersion, SqlTransaction transaction) { var procedures = new StoredProcedures(transaction); procedures.VersionAdd(newVersion.Major, newVersion.Minor, newVersion.Build, DateTime.Now); }
public DatabaseObjectProvider(int blogId, StoredProcedures procedures) { _procedures = procedures; _blogId = new Func<int>(() => blogId); }
public DatabaseObjectProvider() { _procedures = new StoredProcedures(Config.ConnectionString); _blogId = new Func<int>(() => BlogRequest.Current.IsHostAdminRequest ? NullValue.NullInt32 : BlogRequest.Current.Blog.Id); }
public DatabaseObjectProvider(int blogId, StoredProcedures procedures) { _procedures = procedures; _blogId = new Func <int>(() => blogId); }
public DatabaseObjectProvider() { _procedures = new StoredProcedures(Config.ConnectionString); _blogId = new Func <int>(() => BlogRequest.Current.IsHostAdminRequest ? NullValue.NullInt32 : BlogRequest.Current.Blog.Id); }
public SearchEngine(Blog blog, UrlHelper urlHelper, string connectionString) { _blog = blog; _procedures = new StoredProcedures(connectionString); _urlHelper = urlHelper; }