public async Task Resolves_object_ensures_collection_retrieval() { Assert.False(Web.Lists.ServerObjectIsNull.HasValue); var ctx = Context.PushState(base.Web); var resolveCtx = new ClientObjectResolveContext(ctx); resolveCtx.Include<Web>(w => w.Lists.Include(l => l.ItemCount)); var mr = new ClientObjectManualResolver(() => resolveCtx); var resolver = mr.ResolveSingle( new ClientObjectContextStateResolveBuilder<Web>() ); await ClientContext.ExecuteQueryAsync(); var resolvedWeb = resolver.Value; Assert.True(resolvedWeb.Lists.ServerObjectIsNull.HasValue); Assert.False(resolvedWeb.Lists.ServerObjectIsNull.Value); Assert.NotEmpty(resolvedWeb.Lists); Assert.All(resolvedWeb.Lists, list => Assert.True( list.IsPropertyAvailable(l => l.ItemCount) ) ); }
public async Task Resolves_object_ensures_collection_retrieval() { Assert.False(Web.Lists.ServerObjectIsNull.HasValue); var ctx = Context.PushState(base.Web); var resolveCtx = new ClientObjectResolveContext(ctx); resolveCtx.Include <Web>(w => w.Lists.Include(l => l.ItemCount)); var mr = new ClientObjectManualResolver(() => resolveCtx); var resolver = mr.ResolveSingle( new ClientObjectContextStateResolveBuilder <Web>() ); await ClientContext.ExecuteQueryAsync(); var resolvedWeb = resolver.Value; Assert.True(resolvedWeb.Lists.ServerObjectIsNull.HasValue); Assert.False(resolvedWeb.Lists.ServerObjectIsNull.Value); Assert.NotEmpty(resolvedWeb.Lists); Assert.All(resolvedWeb.Lists, list => Assert.True( list.IsPropertyAvailable(l => l.ItemCount) ) ); }
protected override void InitializeResolveContext(ClientObjectResolveContext context) { if (context == null) { throw Logger.Fatal.ArgumentNull(nameof(context)); } context.Include<ContentType>( ct => ct.Name, ct => ct.StringId ); context.Include<List>( list => list.ContentTypes ); base.InitializeResolveContext(context); }
protected override void InitializeResolveContext(ClientObjectResolveContext context) { if (context == null) { throw Logger.Fatal.ArgumentNull(nameof(context)); } base.InitializeResolveContext(context); context.Include <Field>( f => f.Id ); context.Include <FieldLink>( fl => fl.Id, fl => fl.Name ); }
protected override void InitializeResolveContext(ClientObjectResolveContext context) { if (context == null) { throw Logger.Fatal.ArgumentNull(nameof(context)); } context.Include <ContentType>( ct => ct.Name, ct => ct.StringId ); context.Include <List>( list => list.ContentTypes ); base.InitializeResolveContext(context); }
protected override void InitializeResolveContext(ClientObjectResolveContext context) { if (context == null) { throw Logger.Fatal.ArgumentNull(nameof(context)); } context.Load(Web, w => w.Id); context.Include <Field>( f => f.InternalName ); context.Include <List>( list => list.Id ); base.InitializeResolveContext(context); }
protected override void InitializeResolveContext(ClientObjectResolveContext context) { if (context == null) { throw Logger.Fatal.ArgumentNull(nameof(context)); } context.Include <TermSet>( ts => ts.TermStore.Id ); base.InitializeResolveContext(context); }
protected override void InitializeResolveContext(ClientObjectResolveContext context) { if (context == null) { throw Logger.Fatal.ArgumentNull(nameof(context)); } context.Include( Updater.GetRetrievals <TField>() ); base.InitializeResolveContext(context); }
public async Task Resolves_object_ensures_retrievals() { Assert.False(Web.IsPropertyAvailable(w => w.SiteLogoUrl)); var ctx = Context.PushState(ClientContext.Web); var resolveCtx = new ClientObjectResolveContext(ctx); resolveCtx.Include<Web>(w => w.SiteLogoUrl); var mr = new ClientObjectManualResolver(() => resolveCtx); var resolver = mr.ResolveSingle( new ClientObjectContextStateResolveBuilder<Web>() ); await ClientContext.ExecuteQueryAsync(); var resolvedWeb = resolver.Value; Assert.True(resolvedWeb.IsPropertyAvailable(w => w.SiteLogoUrl)); }
public async Task Resolves_object_ensures_retrievals() { Assert.False(Web.IsPropertyAvailable(w => w.SiteLogoUrl)); var ctx = Context.PushState(ClientContext.Web); var resolveCtx = new ClientObjectResolveContext(ctx); resolveCtx.Include <Web>(w => w.SiteLogoUrl); var mr = new ClientObjectManualResolver(() => resolveCtx); var resolver = mr.ResolveSingle( new ClientObjectContextStateResolveBuilder <Web>() ); await ClientContext.ExecuteQueryAsync(); var resolvedWeb = resolver.Value; Assert.True(resolvedWeb.IsPropertyAvailable(w => w.SiteLogoUrl)); }
public async Task Title_gets_resolved_with_InternalName() { var ctx = new ClientObjectResolveContext(Context); ctx.Include <Field>( f => f.InternalName, f => f.Description ); Field = Resolve.Field().ById(HarshBuiltInFieldId.Title); Binder.Bind(this, () => ctx); await ctx.ProvisionerContext.ClientContext.ExecuteQueryAsync(); var field = Field.Value; Assert.NotNull(field); Assert.True(field.IsPropertyAvailable(f => f.Description)); Assert.True(field.IsPropertyAvailable(f => f.InternalName)); Assert.Equal("Title", field.InternalName); }
public async Task Title_gets_resolved_with_InternalName() { var ctx = new ClientObjectResolveContext(Context); ctx.Include<Field>( f => f.InternalName, f => f.Description ); Field = Resolve.Field().ById(HarshBuiltInFieldId.Title); Binder.Bind(this, () => ctx); await ctx.ProvisionerContext.ClientContext.ExecuteQueryAsync(); var field = Field.Value; Assert.NotNull(field); Assert.True(field.IsPropertyAvailable(f => f.Description)); Assert.True(field.IsPropertyAvailable(f => f.InternalName)); Assert.Equal("Title", field.InternalName); }