public WebDaveSqlStoreFileInfo(SqlStoreFileInfo fileInfo, IWebDavStoreCollection parent, string path)
 {
     ObjectGuid = fileInfo.ObjectGuid;
     Archive = fileInfo.Archive;
     Compressed = fileInfo.Compressed;
     CreationTime = fileInfo.CreationTime;
     Device = fileInfo.Device;
     Directory = fileInfo.Directory;
     Encrypted = fileInfo.Encrypted;
     Exists = fileInfo.Exists;
     Hidden = fileInfo.Hidden;
     IntegrityStream = fileInfo.IntegrityStream;
     LastAccessTime = fileInfo.LastAccessTime;
     LastWriteTime = fileInfo.LastWriteTime;
     NoScrubData = fileInfo.NoScrubData;
     Normal = fileInfo.Normal;
     NotContentIndexed = fileInfo.NotContentIndexed;
     Offline = fileInfo.Offline;
     Parent = parent;
     Path = path;
     ReadOnly = fileInfo.ReadOnly;
     ReparsePoint = fileInfo.ReparsePoint;
     SparseFile = fileInfo.SparseFile;
     System = fileInfo.System;
     Temporary = fileInfo.Temporary;
 }
        /// <summary>
        ///     Returns the FileInfo
        /// </summary>
        /// <returns></returns>
        public SqlStoreFileInfo GetFileInfo()
        {
            FileData lastdata;
            if (FileDatas == null)
                using (var context = new OnlineFilesEntities())
                    lastdata = context.FileDatas.OrderByDescending(d => d.Revision).FirstOrDefault();
            else
                lastdata = FileDatas.OrderByDescending(d => d.Revision).FirstOrDefault();

            var fileinfo = new SqlStoreFileInfo
            {
                Parent = null,
                Path = null,
                Exists = true,
                CreationTime = CreateDt,
                LastAccessTime = CreateDt,
                LastWriteTime = lastdata?.CreateDt ?? CreateDt,
                Directory = false,
                Archive = GetWin32Attribute(FileAttributes.Archive),
                Compressed = GetWin32Attribute(FileAttributes.Compressed),
                Device = GetWin32Attribute(FileAttributes.Device),
                Encrypted = GetWin32Attribute(FileAttributes.Encrypted),
                NotContentIndexed = GetWin32Attribute(FileAttributes.NotContentIndexed),
                Offline = GetWin32Attribute(FileAttributes.Offline),
                System = GetWin32Attribute(FileAttributes.System),
                Hidden = GetWin32Attribute(FileAttributes.Hidden),
                IntegrityStream = GetWin32Attribute(FileAttributes.IntegrityStream),
                NoScrubData = GetWin32Attribute(FileAttributes.NoScrubData),
                Normal = GetWin32Attribute(FileAttributes.Normal),
                ReadOnly = GetWin32Attribute(FileAttributes.ReadOnly),
                ReparsePoint = GetWin32Attribute(FileAttributes.ReparsePoint),
                SparseFile = GetWin32Attribute(FileAttributes.SparseFile),
                Temporary = GetWin32Attribute(FileAttributes.Temporary),
                ObjectGuid = pk_FileId
            };
            return fileinfo;
        }
 public SqlStoreFileInfo GetFolderInfo()
 {
     var fileinfo = new SqlStoreFileInfo
     {
         Parent = null,
         Path = null,
         Exists = true,
         CreationTime = CreateDt,
         LastAccessTime = CreateDt,
         LastWriteTime = null,
         Directory = false,
         Archive = GetWin32Attribute(FileAttributes.Archive),
         Compressed = GetWin32Attribute(FileAttributes.Compressed),
         Device = GetWin32Attribute(FileAttributes.Device),
         Encrypted = GetWin32Attribute(FileAttributes.Encrypted),
         NotContentIndexed = GetWin32Attribute(FileAttributes.NotContentIndexed),
         Offline = GetWin32Attribute(FileAttributes.Offline),
         System = GetWin32Attribute(FileAttributes.System),
         Hidden = GetWin32Attribute(FileAttributes.Hidden),
         IntegrityStream = GetWin32Attribute(FileAttributes.IntegrityStream),
         NoScrubData = GetWin32Attribute(FileAttributes.NoScrubData),
         Normal = GetWin32Attribute(FileAttributes.Normal),
         ReadOnly = GetWin32Attribute(FileAttributes.ReadOnly),
         ReparsePoint = GetWin32Attribute(FileAttributes.ReparsePoint),
         SparseFile = GetWin32Attribute(FileAttributes.SparseFile),
         Temporary = GetWin32Attribute(FileAttributes.Temporary),
         ObjectGuid = pk_FolderId
     };
     return fileinfo;
 }