private static string GetOperator(QueryFieldType type) { switch (type) { case QueryFieldType.Equal: return("="); case QueryFieldType.GreaterThan: return(">"); case QueryFieldType.GreaterThanOrEqual: return(">="); case QueryFieldType.LessThan: return("<"); case QueryFieldType.LessThanOrEqual: return("<="); case QueryFieldType.Like: return("LIKE"); case QueryFieldType.NotLike: return("NOT LIKE"); case QueryFieldType.NotEqual: return("!="); default: throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, "Query Field Type '{0}' is not implemented.", type)); } }
public static IEnumerable <QueryField> GetFields(GraphQlMutation query, QueryFieldType type) { var properties = query.GetType().GetProperties(); return (from prop in properties let attr = prop.GetCustomAttribute <QueryFieldAttribute>() where attr != null && attr.Type == type select new QueryField(prop, attr, query, attr.Type)); }
private static DbType ConvertDbType(QueryFieldType qfType) { switch (qfType) { case QueryFieldType.Boolean: return(DbType.Boolean); case QueryFieldType.DateTime: return(DbType.DateTime); case QueryFieldType.Numeric: return(DbType.Decimal); case QueryFieldType.String: return(DbType.String); default: return(DbType.String); } }
public FieldQuery(string name, string value, QueryFieldType valueType) { Name = name; Value = value; ValueType = valueType; }
public QueryFieldAttribute(QueryFieldType type, [CallerMemberName] string name = null, bool expandContents = true) : base(name.ToCamelCase(), expandContents) => Type = type;
public QueryField(PropertyInfo property, QueryFieldAttribute attribute, object parent, QueryFieldType type) : base(property, attribute, parent) => Type = type;