Esempio n. 1
0
        private static ErrorList ValidateAssetFilePath(AssetFilePath assetFilePath)
        {
            ErrorList errors = new ErrorList();

            if (assetFilePath.Path.Trim() == string.Empty)
            {
                errors.Add("Path cannot be empty");
            }
            else if (!Directory.Exists(assetFilePath.Path))
            {
                errors.Add("Path does not exist");
            }
            else
            {
                AssetFilePathFinder finder = new AssetFilePathFinder {
                    Path = assetFilePath.Path.Trim()
                };
                AssetFilePath afp = AssetFilePath.FindOne(finder);

                if (afp.Path == assetFilePath.Path && afp.AssetFilePathId.GetValueOrDefault(-1) != assetFilePath.AssetFilePathId.GetValueOrDefault(0))
                {
                    errors.Add("The specified path already has already been entered");
                }
            }

            return(errors);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets list of asset file paths
        /// </summary>
        public static EntityList <AssetFilePath> GetList()
        {
            AssetFilePathFinder finder = new AssetFilePathFinder();

            return(AssetFilePath.FindMany(finder));
        }