Exemple #1
0
        public override IWebDavFileInfo GetFileInfo()
        {
            if (_fileinfo != null)
            {
                return(_fileinfo);
            }

            using (var context = new OnlineFilesEntities())
            {
                File file = context.Files.AsNoTracking().Include(x => x.FileDatas).FirstOrDefault(d => d.pk_FileId == ObjectGuid);
                if (file == null)
                {
                    return new WebDaveSqlStoreFileInfo
                           {
                               Parent    = ParentCollection,
                               Path      = string.Empty,
                               Exists    = false,
                               Directory = false
                           }
                }
                ;

                _fileinfo = new WebDaveSqlStoreFileInfo(file.GetFileInfo(), ParentCollection, ItemPath);

                return(_fileinfo);
            }
        }
    }
        public override IWebDavFileInfo GetFileInfo()
        {
            if (_fileinfo != null)
                return _fileinfo;

            using (var context = new OnlineFilesEntities())
            {
                File file = context.Files.AsNoTracking().Include(x => x.FileDatas).FirstOrDefault(d => d.pk_FileId == ObjectGuid);
                if (file == null)
                    return new WebDaveSqlStoreFileInfo
                    {
                        Parent = ParentCollection,
                        Path = string.Empty,
                        Exists = false,
                        Directory = false
                    };

                _fileinfo = new WebDaveSqlStoreFileInfo(file.GetFileInfo(), ParentCollection, ItemPath);

                return _fileinfo;
            }
        }