Exemplo n.º 1
0
        public IList <FileModel> FilterBasedOnAuthorizationsAndPopulateNiceNameAndDescription(IList <FileModel> files, IList <File> filelist)
        {
            IList <FileModel> resultantfiles = new List <FileModel>();
            List <String>     virttualPaths  = new List <String>();

            foreach (var item in files)
            {
                String      virtualPath  = UtilityOperations.GetVirtualPath(item.FullPath);
                List <File> tempfilelist = filelist.Where(x => x.VirtualPath == virtualPath).ToList();
                if (tempfilelist.Count != 0)
                {
                    item.NiceNameOrAreaName = tempfilelist[0].NiceNameOrAreaName;
                    item.Description        = tempfilelist[0].Description;
                    resultantfiles.Add(item);
                }
            }
            return(resultantfiles);
        }
Exemplo n.º 2
0
        public void PopulateNiceNameAndDescription(IList <FileModel> files)
        {
            List <String> virtualPaths = new List <String>();

            foreach (var item in files)
            {
                virtualPaths.Add(UtilityOperations.GetVirtualPath(item.FullPath));
            }
            DocumentsOperations documentsOperations = new DocumentsOperations();
            List <File>         filelist            = documentsOperations.GetFilesByVirtualPaths(virtualPaths);

            foreach (var item in files)
            {
                List <File> tempfilelist = filelist.Where(x => x.Name == item.Name).ToList();
                if (tempfilelist.Count != 0)
                {
                    item.NiceNameOrAreaName = tempfilelist[0].NiceNameOrAreaName;
                    item.Description        = tempfilelist[0].Description;
                }
            }
        }