예제 #1
0
        //  -------------
        //  Create method
        //  -------------

        /// <summary>
        /// Creates a new instance of the <see cref="Manager"/> class.
        /// </summary>
        /// <returns>A newly created instance of the <see cref="Manager"/>
        ///     class.</returns>

        public static Manager Create()
        {
            var dictionary = InstalledVersions.FromRegistry();

            if (dictionary.Count == 0)
            {
                throw new LocalDbException(Strings.NotInstalled);
            }
            return(new Manager(dictionary.LastOrDefault().Value));
        }
예제 #2
0
        //  ------------------
        //  IsInstalled method
        //  ------------------

        /// <summary>
        /// Determines whether SQL Server Express LocalDB is installed on the
        /// computer.
        /// </summary>
        /// <returns><c>true</c> if SQL Server Express LocalDB is installed on
        ///     the computer; otherwise, <c>false</c>.</returns>

        public static bool IsInstalled() => InstalledVersions.FromRegistry().Count > 0;