private bool IsFolderNameAlreadyExists(IUserFolderDao userFolderDao, UserFolder newUserFolder)
        {
            //Find folder sub-folders
            var exp = SimpleUserFoldersExp.CreateBuilder(Tenant, User)
                      .SetParent(newUserFolder.ParentId)
                      .Build();

            var listExistinFolders = userFolderDao.GetList(exp);

            return(listExistinFolders.Any(existinFolder => existinFolder.Name.Equals(newUserFolder.Name,
                                                                                     StringComparison.InvariantCultureIgnoreCase)));
        }
        private bool CanMoveFolderTo(IUserFolderDao userFolderDao, UserFolder newUserFolder)
        {
            //Find folder sub-folders
            var exp = SimpleUserFoldersExp.CreateBuilder(Tenant, User)
                      .SetParent(newUserFolder.Id)
                      .SetIds(new List <uint> {
                newUserFolder.ParentId
            })
                      .Build();

            var listExistinFolders = userFolderDao.GetList(exp);

            return(!listExistinFolders.Any());
        }