handler mapping of string to varchar in dapper
问题 i found these code in dapper: sealed partial class DbString : Dapper.SqlMapper.ICustomQueryParameter { ... public void AddParameter(IDbCommand command, string name) { ... var param = command.CreateParameter(); param.ParameterName = name; param.Value = (object)Value ?? DBNull.Value; if (Length == -1 && Value != null && Value.Length <= 4000) { param.Size = 4000; } else { param.Size = Length; } ... } } can you tell me why code here need to compare the lenght to 4000? thank you. 回答1: Query-plan