Beispiel #1
0
        public IField WithValueGetter(FieldValueGetter fieldGetter)
        {
            if (fieldGetter == null)
            {
                throw new ArgumentNullException("fieldGetter");
            }

            this.ValueGetter = fieldGetter;
            return(this);
        }
Beispiel #2
0
        internal static ITableObject invokeGet(NrdoSingleGet get, FieldValueGetter getFieldValue)
        {
            if (get.Params.Count > 0 || get.ParamTables.Count > 0)
            {
                throw new ArgumentException("Get by " + get.Name + " is not eligible for use in nrdo.find.by since it has parameters that are not fields");
            }
            object[] args = new object[get.Fields.Count];
            int      i    = 0;

            foreach (NrdoFieldRef field in get.Fields)
            {
                if (!field.Table.IsSelf)
                {
                    throw new ArgumentException("Get by " + get.Name + " is not eligible for use in nrdo.find.by since it uses fields not on the current table");
                }
                object value = getFieldValue(field.Field);
                args[i++] = value;
                if (value is Undefined)
                {
                    return(null);                    // We skip attempts to call gets on Undefined values because the value is inherently unknown, the get couldn't succeed.
                }
            }
            return(get.Call(args));
        }
Beispiel #3
0
 public RecordKey(NrdoTable table, FieldValueGetter getValue)
 {
     this.table    = table;
     this.getValue = getValue;
 }