Service update, import changes from web_portal

This commit is contained in:
Claudio Boggian
2023-06-21 10:38:57 +02:00
parent 39fa4dedf3
commit bb99cef33c
101 changed files with 4266 additions and 3044 deletions
@@ -1,13 +1,10 @@
using console_spo_utils.Enums;
using console_spo_utils.Interfaces.Services;
using library_spo_utils.Constants;
using library_spo_utils.Enums;
using library_spo_utils.Interfaces.Services;
using Microsoft.Extensions.Logging;
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using System.Security;
using System.Xml.Linq;
using console_spo_utils.Constants;
namespace console_spo_utils.Services
namespace library_spo_utils.Services
{
internal class SharePointCustomOperation : ISharePointCustomOperation
{
@@ -59,6 +56,22 @@ namespace console_spo_utils.Services
}
}
public bool FolderExist(ClientContext ctx, string path)
{
var folder = ctx.Web.GetFolderByServerRelativeUrl(path).Folders;
ctx.Load(folder, f => f.Include(fi => fi.ListItemAllFields));
try
{
ctx.ExecuteQuery();
return true;
}
catch (Exception)
{
return false;
}
}
public bool FolderExistsInsideList(ClientContext context, string listTitle, string folderName)
{
var folderExists = context.Web.Lists.GetByTitle(listTitle).RootFolder;