public static IProjection IsEq(this IProjection projection, IProjection other)
        {
            List <IProjectionAttribute> newAttrs = new List <IProjectionAttribute>();

            foreach (var(l, r) in projection.Attrs().Zip(other.Attrs()))
            {
                IProjectionAttribute newAttr = l;

                newAttr = newAttr.Eq();
                newAttr = newAttr.With(metadata: r.Metadata, field: r.Field).Par();
                newAttr = newAttr.With(metadata: l.Metadata, field: l.Field);

                newAttrs.Add(newAttr);
            }

            return(projection.With(attributes: newAttrs));
        }
Beispiel #2
0
        public static IProjection IsEq(this IProjection projection, IProjection other)
        {
            List <IProjectionAttribute> newHeader = new List <IProjectionAttribute>();

            foreach (var(l, r) in projection.Attrs().Zip(other.Attrs()))
            {
                IProjectionAttribute newAttr = l;

                newAttr = newAttr.Eq();
                newAttr = newAttr.With(data: r.Data).Par();
                newAttr = newAttr.With(data: l.Data);

                newHeader.Add(newAttr);
            }

            ProjectionOptions newOptions = new ProjectionOptions(projection.Options)
            {
                Separator = Environment.NewLine + "AND" + Environment.NewLine,
            };

            return(projection.With(header: newHeader, options: newOptions));
        }
        public static IProjection IsEq(this IProjection projection, IProjection other)
        {
            List <IProjectionAttribute> newAttrs = new List <IProjectionAttribute>();

            foreach (var(l, r) in projection.Attrs().Zip(other.Attrs()))
            {
                IProjectionAttribute newAttr = l;

                newAttr = newAttr.Eq();
                newAttr = newAttr.With(metadata: r.Metadata, field: r.Field).Par();
                newAttr = newAttr.With(metadata: l.Metadata, field: l.Field);

                newAttrs.Add(newAttr);
            }

            ProjectionOptions newOptions = new ProjectionOptions(projection.Options)
            {
                Separator = Environment.NewLine + "AND" + Environment.NewLine,
            };

            return(projection.With(attributes: newAttrs, options: newOptions));
        }