src/SQLRenderer/SQLRenderer.cs
/// <summary>
/// Returns a list of fields that are
///    - stand alone single field
///    - single field that are part of entity and got referenced
/// </summary>
/// <returns></returns>
Returns a list of fields that are
stand alone single field
single field that are part of entity and got referenced
Returns a list of fields that are stand alone single field single field that are part of entity and got referenced
private IEnumerable<(string EntityAlias, string PropertyName, Type FieldType, bool IsKeyfield)> ExpandSchema(Schema schema)
        {
            return schema
                .Where(f => f is EntityField).Cast<EntityField>()
                    .SelectMany(ef => ef.ReferencedFieldAliases
                        .Select(fn => (
                            EntityAlias: ef.FieldAlias,
                            PropertyName: fn,
                            FieldType: ef.EncapsulatedFields.First(f2 => fn == f2.FieldAlias).FieldType,
                            IsKeyfield: fn == ef.NodeJoinField?.FieldAlias || fn == ef.RelSourceJoinField?.FieldAlias || fn == ef.RelSinkJoinField?.FieldAlias
                            )))
                .Union(schema
                    .Where(f => f is ValueField).Cast<ValueField>()
                    .Select(fn => (EntityAlias: (string)null, PropertyName: fn.FieldAlias, FieldType: fn.FieldType, IsKeyfield: false)));
        }
private IEnumerable < ( string EntityAlias , string PropertyName , Type FieldType , bool IsKeyfield ) > ExpandSchema ( Schema schema ) { return schema . Where ( f => f is EntityField ) . Cast < EntityField > ( ) . SelectMany ( ef => ef . ReferencedFieldAliases . Select ( fn => ( EntityAlias : ef . FieldAlias , PropertyName : fn , FieldType : ef . EncapsulatedFields . First ( f2 => fn == f2 . FieldAlias ) . FieldType , IsKeyfield : fn == ef . NodeJoinField ? . FieldAlias || fn == ef . RelSourceJoinField ? . FieldAlias || fn == ef . RelSinkJoinField ? . FieldAlias ) ) ) . Union ( schema . Where ( f => f is ValueField ) . Cast < ValueField > ( ) . Select ( fn => ( EntityAlias : ( string ) null , PropertyName : fn . FieldAlias , FieldType : fn . FieldType , IsKeyfield : false ) ) ) ; }
Returns a list of fields that are
 stand alone single field
 single field that are part of entity and got referenced
Returns a list of fields that are stand alone single field single field that are part of entity and got referenced
None
schema
Schema