private void DefaultAppendField(PropertyMapper property, StringBuilder builder, DefaultParameterSettings parameterSettings) { builder.Append(parameterSettings.EscapeName(property.Name)); }
private void DefaultAppendValue(PropertyMapper property, StringBuilder builder, DefaultParameterSettings parameterSettings , object value , ExecuteParameterCollection ps) { var upperName = property.Name.ToUpper(); builder.Append(parameterSettings.PrefixWithText) .Append(upperName); ps.Add(parameterSettings.PrefixWithCollection + upperName, value); }
private ExecuteCommand CreateDeleteCommand(TypeMapper mapper, StringBuilder whereBuilder, DefaultParameterSettings parSettings, ExecuteParameterCollection ps, string tableName) { if (whereBuilder.Length == 0) { throw new NotSupportedException("{0} 的删除操作没有找到主键。".Fmt(mapper.Type.FullName)); } whereBuilder.Insert(0, " WHERE "); whereBuilder.Insert(0, parSettings.EscapeName(tableName ?? mapper.Name)); whereBuilder.Insert(0, "DELETE "); return(new ExecuteCommand(whereBuilder.ToString(), ps)); }