private string PrepareWhereSql() { SqlText.Append(" where "); Separator = null; foreach (var i in SqlColumns) { if (!i.IsInPrimaryKey) { continue; } AddSeparator(" AND "); SqlText.Append(Encode(i.ColumnName) + "=@p" + ParameterValues.Count); ParameterValues.Add(i.ValueReader.ReadPropertyValue(Entity)); } var whereSql = SqlText.ToString(); SqlText.Clear(); return(whereSql); }