コード例 #1
0
        /// <summary>
        /// Lists all validation errors for the SQLite mappings in the config
        /// </summary>
        /// <param name="outputToConsole">Whether the errors should be outputted to the console as well. Defaults to false.</param>
        /// <returns>All the errors for each mapping in the config file.</returns>
        public static IEnumerable <string> ListConfigErrors()
        {
            SQLiteMappingConfig config = GetConfig();

            foreach (Mapping map in config.Mappings)
            {
                if (!SQLite.IsDataType(map.To))
                {
                    string errorString = $"{map.From}->{map.To} : {map.To} is not a valid SQLite data type";
                    yield return(errorString);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Validate the SQLite Mappings from the config
        /// </summary>
        /// <returns>True, if SQLite types specified in the config are valid. Otherwise, false.</returns>
        public static bool ValidateConfig()
        {
            SQLiteMappingConfig config = GetConfig();

            foreach (Mapping map in config.Mappings)
            {
                if (!SQLite.IsDataType(map.To))
                {
                    return(false);
                }
            }
            return(true);
        }