Use Mapster as mapper (#39)

* mapster

* ,

* .

* ...

* .

* .

* .

* .

* .

* .

* int

* .

* ;
This commit is contained in:
Stef Heyenrath
2022-09-05 21:26:02 +02:00
committed by GitHub
parent 4b9b47ba9d
commit 0e57de17c3
39 changed files with 378 additions and 405 deletions
@@ -1,14 +1,59 @@
using System;
using System.Threading.Tasks;
using Microsoft.SharePoint.Client;
using ProxyInterfaceConsumer.PnP;
using PnP.Core.Model.SharePoint;
using PnP.Framework;
using ProxyInterfaceConsumerForPnP.Implementations;
using ProxyInterfaceConsumerForPnP.Interfaces;
using IWeb = ProxyInterfaceConsumerForPnP.Interfaces.IWeb;
namespace ProxyInterfaceConsumerForPnP
namespace ProxyInterfaceConsumerForPnP;
public class Program
{
public class Program
public static async Task Main()
{
public static void Main()
try
{
var cp = new ClientContextProxy(new ClientContext("https://heyenrath.nl"));
cp.Test();
var authManager = new AuthenticationManager(
"15b347bf-90a2-4c16-aa76-5a3263476b59",
"Test.pfx",
Environment.GetEnvironmentVariable("Test.pfx_PWD"),
"s7gb6.onmicrosoft.com");
using var clientContext = await authManager.GetContextAsync("https://s7gb6.sharepoint.com/sites/Test");
clientContext.Load(clientContext.Web, p => p.Title);
await clientContext.ExecuteQueryRetryAsync();
Console.WriteLine(clientContext.Web.Title);
IClientContext cp = new ClientContextProxy(clientContext);
cp.Load<IWeb, Web>(cp.Web, w => w.Lists, w => w.Language, w => w.Author);
await cp.ExecuteQueryRetryAsync();
Console.WriteLine(cp.Web.Title + "," + cp.Web.Language + "," + cp.Web.Author.Email);
foreach (var list in cp.Web.Lists)
{
Console.WriteLine(" list : {0}", list.Title);
}
foreach (var list in cp.Web.Lists)
{
cp._Instance.Load(list, l => l.Author.Email);
}
await cp.ExecuteQueryRetryAsync();
Console.WriteLine(new string('-', 80));
foreach (var list in cp.Web.Lists)
{
Console.WriteLine(" list : {0} '{1}'", list.Title, list.Author.Email);
}
}
catch (Exception ex)
{
Console.WriteLine("Error Message: " + ex.Message);
}
}
}