public ResolveFieldById( IResolveBuilder <Field> parent, IEnumerable <Guid> identifiers ) : base(parent, identifiers, f => f.Id) { }
public ResolveListViewByUrl( IResolveBuilder <View> parent, IEnumerable <String> identifiers ) : base(parent, identifiers, StringComparer.OrdinalIgnoreCase) { }
public ResolveListByUrl( IResolveBuilder <List> parent, IEnumerable <String> urls ) : base(parent, urls, StringComparer.OrdinalIgnoreCase) { }
protected IdentifierResolveBuilder( IResolveBuilder <TResult> parent, IEnumerable <TIdentifier> identifiers ) : this(parent, identifiers, null) { }
public ResolveTermSetById( IResolveBuilder <TermSet> parent, IEnumerable <Guid> identifiers ) : base(parent, identifiers, ts => ts.Id) { }
public ResolveFieldByInternalName( IResolveBuilder <Field> parent, IEnumerable <String> identifiers ) : base(parent, identifiers, f => f.InternalName) { }
protected IdentifierResolveBuilder( IResolveBuilder <TResult> parent, IEnumerable <TIdentifier> identifiers, IEqualityComparer <TIdentifier> identifierComparer ) { if (parent == null) { throw Logger.Fatal.ArgumentNull(nameof(parent)); } if (identifiers == null) { throw Logger.Fatal.ArgumentNull(nameof(identifiers)); } if (identifierComparer == null) { identifierComparer = EqualityComparer <TIdentifier> .Default; } Parent = parent; Identifiers = ImmutableHashSet.CreateRange( identifierComparer, identifiers ); }
public ResolveListById( IResolveBuilder <List> parent, IEnumerable <Guid> identifiers ) : base(parent, identifiers, l => l.Id) { }
private static Object CreateResult( PropertyAccessor property, IResolveBuilder resolveBuilder, IEnumerable resultSource, IEnumerable <ResolveFailure> failureSource ) { if (resultSource == null) { Logger.Warning( "Property {PropertyName} resolver {$Resolver} resolved into null value.", property.Name, resolveBuilder ); return(null); } var result = ResolveResultFactory.CreateResult( property.PropertyTypeInfo, resultSource, resolveBuilder, failureSource ); Logger.Debug( "Property {PropertyName} resolver {$Resolver} result adapted into {$Value}, assigning.", property.Name, resolveBuilder, result ); return(result); }
public ResolveContentTypeById( IResolveBuilder <ContentType> parent, IEnumerable <HarshContentTypeId> ids ) : base(parent, ids) { }
protected ClientObjectIdentifierResolveBuilder( IResolveBuilder <TResult> parent, IEnumerable <TIdentifier> identifiers, Expression <Func <TResult, TIdentifier> > identifierExpression ) : this(parent, identifiers, null, identifierExpression) { }
public ResolveBuilderAdapter(IResolveBuilder builder) { if (builder == null) { throw Logger.Fatal.ArgumentNull(nameof(builder)); } _inner = builder; }
protected async Task <IEnumerable <T> > ResolveAsync <T>(IResolveBuilder <T, ClientObjectResolveContext> builder) where T : ClientObject { var results = ManualResolver.Resolve(builder); await ClientContext.ExecuteQueryAsync(); return(results); }
public static IResolveBuilder <TResult> As <TResult>(this IResolveBuilder builder) { if (builder == null) { throw Logger.Fatal.ArgumentNull(nameof(builder)); } return(new ResolveBuilderAdapter <TResult>(builder)); }
protected NestedResolveBuilder(IResolveBuilder <TParent> parent) { if (parent == null) { throw Logger.Fatal.ArgumentNull(nameof(parent)); } Parent = parent; }
public ResolveFailure(IResolveBuilder resolveBuilder, Object identifier) { if (resolveBuilder == null) { throw Logger.Fatal.ArgumentNull(nameof(resolveBuilder)); } ResolveBuilder = resolveBuilder; Identifier = identifier; }
protected ClientObjectNestedResolveBuilder( IResolveBuilder <TParent> parent, Expression <Func <TParent, IEnumerable <TResult> > > childrenExpression ) : base(parent) { if (childrenExpression == null) { throw Logger.Fatal.ArgumentNull(nameof(childrenExpression)); } ChildrenExpression = childrenExpression.ConvertToObject(); ChildrenSelector = childrenExpression.Compile(); }
public void AddFailure(IResolveBuilder resolveBuilder, Object identifier) { if (resolveBuilder == null) { throw Logger.Fatal.ArgumentNull(nameof(resolveBuilder)); } if (_failures == null) { _failures = new List <ResolveFailure>(); } _failures.Add(new ResolveFailure(resolveBuilder, identifier)); }
protected ClientObjectIdentifierResolveBuilder( IResolveBuilder <TResult> parent, IEnumerable <TIdentifier> identifiers, IEqualityComparer <TIdentifier> identifierComparer, Expression <Func <TResult, TIdentifier> > identifierExpression ) : base(parent, identifiers, identifierComparer) { if (identifierExpression == null) { throw Logger.Fatal.ArgumentNull(nameof(identifierExpression)); } IdentifierExpression = identifierExpression.ConvertToObject(); IdentifierSelector = identifierExpression.Compile(); }
public static Object CreateResult( TypeInfo propertyTypeInfo, IEnumerable enumerable, IResolveBuilder builder, IEnumerable <ResolveFailure> failures ) { if (propertyTypeInfo == null) { throw Logger.Fatal.ArgumentNull(nameof(propertyTypeInfo)); } if (enumerable == null) { throw Logger.Fatal.ArgumentNull(nameof(enumerable)); } if (builder == null) { throw Logger.Fatal.ArgumentNull(nameof(builder)); } if (failures == null) { throw Logger.Fatal.ArgumentNull(nameof(failures)); } var property = ResolvedPropertyTypeInfo.Parse(propertyTypeInfo); var enumerableTypes = GetEnumerableTypes(enumerable.GetType()) .ToArray(); if (!enumerableTypes.Contains(property.ResolvedType)) { enumerable = CreateConverter(enumerable, property.ResolvedType); } var result = CreateResult(property); result.ResolveBuilder = builder; result.ResolveFailures = failures; result.Results = enumerable; return(result); }
public static Object CreateResult( TypeInfo propertyTypeInfo, IEnumerable enumerable, IResolveBuilder builder, IEnumerable<ResolveFailure> failures ) { if (propertyTypeInfo == null) { throw Logger.Fatal.ArgumentNull(nameof(propertyTypeInfo)); } if (enumerable == null) { throw Logger.Fatal.ArgumentNull(nameof(enumerable)); } if (builder == null) { throw Logger.Fatal.ArgumentNull(nameof(builder)); } if (failures == null) { throw Logger.Fatal.ArgumentNull(nameof(failures)); } var property = ResolvedPropertyTypeInfo.Parse(propertyTypeInfo); var enumerableTypes = GetEnumerableTypes(enumerable.GetType()) .ToArray(); if (!enumerableTypes.Contains(property.ResolvedType)) { enumerable = CreateConverter(enumerable, property.ResolvedType); } var result = CreateResult(property); result.ResolveBuilder = builder; result.ResolveFailures = failures; result.Results = enumerable; return result; }
private static IEnumerable CreateResultSource(String propertyName, IResolveBuilder resolveBuilder, IResolveContext resolveContext) { Logger.Debug( "Property {PropertyName} resolver {$Resolver} initializing.", propertyName, resolveBuilder ); var resultSource = resolveBuilder.ToEnumerable( resolveContext , resolveBuilder.Initialize(resolveContext)); Logger.Debug( "Property {PropertyName} resolver {$Resolver} resolved into {$Value}.", propertyName, resolveBuilder, resultSource ); return(resultSource); }
private void InitializeInner(IResolveContext context) { _inner = _factory(); _inner.InitializeContext(context); }
public ResolveContentTypeFieldLink(IResolveBuilder <ContentType, ClientObjectResolveContext> parent) : base(parent, ct => ct.FieldLinks) { }
public ResolveTermStoreTermSet(IResolveBuilder <TermStore, ClientObjectResolveContext> parent) : base(parent) { }
public ResolveListRootFolder(IResolveBuilder <List, ClientObjectResolveContext> parent) : base(parent, l => l.RootFolder) { }
public ResolveFailure(IResolveBuilder resolveBuilder) : this(resolveBuilder, null) { }
public ResolveListContentType(IResolveBuilder <List> parent) : base(parent, l => l.ContentTypes) { }
private static Object CreateResult( PropertyAccessor property, IResolveBuilder resolveBuilder, IEnumerable resultSource, IEnumerable<ResolveFailure> failureSource ) { if (resultSource == null) { Logger.Warning( "Property {PropertyName} resolver {$Resolver} resolved into null value.", property.Name, resolveBuilder ); return null; } var result = ResolveResultFactory.CreateResult( property.PropertyTypeInfo, resultSource, resolveBuilder, failureSource ); Logger.Debug( "Property {PropertyName} resolver {$Resolver} result adapted into {$Value}, assigning.", property.Name, resolveBuilder, result ); return result; }
private static IEnumerable CreateResultSource(String propertyName, IResolveBuilder resolveBuilder, IResolveContext resolveContext) { Logger.Debug( "Property {PropertyName} resolver {$Resolver} initializing.", propertyName, resolveBuilder ); var resultSource = resolveBuilder.ToEnumerable( resolveContext , resolveBuilder.Initialize(resolveContext)); Logger.Debug( "Property {PropertyName} resolver {$Resolver} resolved into {$Value}.", propertyName, resolveBuilder, resultSource ); return resultSource; }
public ResolveListField(IResolveBuilder <List, ClientObjectResolveContext> parent) : base(parent, l => l.Fields) { }
public ResolveListView(IResolveBuilder <List, ClientObjectResolveContext> parent) : base(parent, l => l.Views) { }
public static ResolveTermStoreTermSet TermSet(this IResolveBuilder <TermStore, ClientObjectResolveContext> termStore) => new ResolveTermStoreTermSet(termStore);