private static bool ImplementsListInterface(IExtendedType type)
 {
     return(GetElementType(type) != null);
 }
 public static bool IsAssignableFrom(
     this Type type,
     IExtendedType extendedType) =>
 type.IsAssignableFrom(extendedType.Type);
 private static bool IsResolverResultType(IExtendedType type)
 {
     return(type.IsGeneric &&
            (typeof(IResolverResult <>) == type.Definition ||
             typeof(ResolverResult <>) == type.Definition));
 }
 private static bool IsNonNullType(IExtendedType type)
 {
     return(type.IsGeneric &&
            typeof(NonNullType <>) == type.Definition);
 }
 private static bool IsSupportedCollectionInterface(IExtendedType type) =>
 IsSupportedCollectionInterface(type, false);
 private static bool IsTaskType(IExtendedType type)
 {
     return(type.IsGeneric &&
            (typeof(Task <>) == type.Definition ||
             typeof(ValueTask <>) == type.Definition));
 }
Esempio n. 7
0
 public QueryableSimpleMethodTest(ITypeInspector typeInspector)
 {
     _extendedType = typeInspector.GetReturnType(Method);
 }
Esempio n. 8
0
 public TypeComponent(TypeComponentKind kind, IExtendedType type)
 {
     Kind = kind;
     Type = type;
 }
Esempio n. 9
0
 private static bool IsWrapperType(IExtendedType type) =>
 type.IsGeneric &&
 typeof(NativeType <>) == type.Definition;
Esempio n. 10
0
 private static bool IsOptional(IExtendedType type) =>
 type.IsGeneric &&
 typeof(Optional <>) == type.Definition;
Esempio n. 11
0
 public static IExtendedType Unwrap(IExtendedType type) =>
 RemoveNonEssentialParts(type);
 protected abstract CursorPagingHandler CreateHandler(
     IExtendedType source,
     PagingOptions options);
 public override bool CanHandle(IExtendedType source)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Specifies if this paging provider can handle the specified <see cref="source"/>.
 /// </summary>
 /// <param name="source">
 /// The source type represents the result of the field resolver and could be a collection,
 /// a query builder or some other object representing the data set.
 /// </param>
 public abstract bool CanHandle(IExtendedType source);
 private static bool IsNonEssentialComponent(IExtendedType type)
 {
     return(IsTaskType(type) || IsResolverResultType(type));
 }
 IPagingHandler IPagingProvider.CreateHandler(
     IExtendedType source,
     PagingOptions options) =>
 CreateHandler(source, options);
Esempio n. 17
0
 private static IPagingProvider ResolvePagingProvider(
     IServiceProvider services,
     IExtendedType source) =>
 services.GetServices <IPagingProvider>().First(p => p.CanHandle(source));