示例#1
0
        /// <summary>
        /// returns Key-Value collection
        /// </summary>
        /// <param name="data"></param>
        /// <param name="argsToAppend"></param>
        /// <returns></returns>
        public object [] GetValues(object data, params object[] argsToAppend)
        {
            var args = new object[Fields.Length * 2 + argsToAppend.Length];

            int j = 0;

            for (int i = 0; i < Fields.Length; i++)
            {
                args[j++] = Fields[i].Name;
                object value = Fields[i].GetValue(data);

                args[j++] = DbConverter.SetValue(Fields[i], value);
            }
            argsToAppend.CopyTo(args, j);

            return(args);
        }