Beispiel #1
0
        public static string GetWherePKPredicate(RowInfo rowInfo)
        {
            DbSetInfo dbSetInfo = rowInfo.dbSetInfo;

            FieldInfo[]   pkFieldsInfo = dbSetInfo.GetPKFieldInfos();
            StringBuilder sb           = new StringBuilder();

            for (int i = 0; i < pkFieldsInfo.Length; ++i)
            {
                if (i > 0)
                {
                    sb.Append(" and ");
                }
                sb.AppendFormat("{0}=@{1}", pkFieldsInfo[i].fieldName, i);
            }
            string predicate = sb.ToString();

            return(predicate);
        }