Exemple #1
0
        IEnumerable <String> WhereClause(TypeContainer tc, IEnumerable <SqlPredicate> t1Predicates)
        {
            if (t1Predicates.Any())
            {
                foreach (var c in t1Predicates)
                {
                    PropertyContainer pc = tc.GetProperty(c.propertyName);
                    if (pc == null)
                    {
                        throw new Exception($"Could not find property - {c.propertyName} on type - {t1.tableName} for join operation");
                    }

                    if (pc.PropertyType != typeof(String) && pc.PropertyType.IsEnum == false)
                    {
                        throw new Exception(
                                  $"Currently join only works on strings and enums ... - {c.propertyName} - {t1.tableName}");
                    }
                    // assume string for now ...
                    if (tc == t1.typeContainer)
                    {
                        yield return($" A.{c.propertyName} = '{c.propertyValue.ToString()}' ");
                    }
                    else
                    {
                        yield return($" B.{c.propertyName} = '{c.propertyValue.ToString()}' ");
                    }
                }
            }
        }
Exemple #2
0
 public Object GetValue(string name)
 {
     return(typeContainer.GetProperty(name).GetValue(this));
 }