Configure a custom data type mapping for use with a System.Data.SqlClient.SqlParameter
问题 I have a struct called CaseInsensitiveString which is just a wrapper that allows my program to work with strings without caring about their case. When it is persisted to a DB, it is no different from a regular string, though, so I want to be able to use it with a System.Data.SqlClient.SqlParameter like this: var myString = new CaseInsensitiveString("foo"); var param = new SqlParameter("@MyValue", myString); Of course I can't do that because SqlParameter doesn't know about my