AsResult IResult.As <T>(string aliasName, out T alias)
        {
            AsResult retval = As(aliasName, out AliasResult genericAlias);

            alias = (T)(object)genericAlias;
            return(retval);
        }
            internal FieldInfo(Transaction transaction, AsResult field)
            {
                Field      = field;
                FieldName  = field.GetFieldName() ?? throw new InvalidOperationException("GetFieldName() cannot be null here.");
                TargetType = field.GetResultType();
                ResultType = field.Result.GetType();
                Info       = ResultHelper.Of(ResultType);

                Conversion?converter = (TargetType is null) ? null : transaction.PersistenceProviderFactory.GetConverterFromStoredType(TargetType);

                ConvertMethod = (converter is null) ? null : (Func <object?, object?>)converter.Convert;

                Entity?    entity          = null;
                MethodInfo?getEntityMethod = ResultType.GetProperty("Entity")?.GetGetMethod();

                if (getEntityMethod is not null)
                {
                    entity = getEntityMethod.Invoke(field.Result, null) as Entity;
                }

                MethodInfo?method = (entity is null) ? null : entity !.RuntimeClassType !.GetMethod("Map", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy, null, new Type[] { typeof(RawNode), typeof(string), typeof(Dictionary <string, object>), typeof(NodeMapping) }, null);

                MapMethod = (method is null) ? null : (Func <RawNode, string, Dictionary <string, object?>?, NodeMapping, OGM?>)Delegate.CreateDelegate(typeof(Func <RawNode, string, Dictionary <string, object?>?, NodeMapping, OGM?>), method, true);

                if (entity is null)
                {
                    return;
                }

                Type            listType       = typeof(List <>).MakeGenericType(entity.RuntimeReturnType);
                Type            jaggedListType = typeof(List <>).MakeGenericType(listType);
                ConstructorInfo listCtor       = listType.GetConstructor(new Type[] { typeof(int) });
                ConstructorInfo jaggedListCtor = jaggedListType.GetConstructor(new Type[] { typeof(int) });

                ParameterExpression capacity1 = Expression.Parameter(typeof(int), "capacity");
                ParameterExpression capacity2 = Expression.Parameter(typeof(int), "capacity");

                NewList       = Expression.Lambda <Func <int, IList> >(Expression.New(listCtor, capacity1), capacity1).Compile();
                NewJaggedList = Expression.Lambda <Func <int, IList> >(Expression.New(jaggedListCtor, capacity2), capacity2).Compile();
            }