Service update, import changes from web_portal
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user