//private void ResolveOneToManyColumnRelationships() //{ // Fields.ToList().ForEach(d => // { // var x = d.Arguments // .Where(a => a.Type == typeof(ListGraphType<EntityType>) && a.ResolvedType == null); // x.ToList().ForEach(a => a.ResolvedType = EntityType.EntitiesAlreadyCreated[a.Description]); // }); //} private void ApplyParameters(WhereBuilder where, IReadOnlyDictionary <string, object> args, IResolveFieldContext _, SqlTable __) { var userArguments = args.Where(d => d.Value != null); foreach (var(key, _) in userArguments) { where.Column(key, args[key]); } }
public void Column_WhenOperatorIsNull_ThrowsException() { var builder = new WhereBuilder("table", new List <WhereCondition>()); Action action = () => builder.Column("id", 1, null); action.Should() .Throw <ArgumentNullException>() .Which.ParamName.Should() .Be("operator"); }
public void Column_WithColumnAndValue_AddsConditionToList() { var whereConditions = new List <WhereCondition>(); var builder = new WhereBuilder("table", whereConditions); builder.Column("id", 1); whereConditions.Should() .ContainSingle() .Which.Should() .BeEquivalentTo(new CompareCondition("table", "id", "=", 1)); }