Hi,
We are using linq-to-sql entities,and want to implement trimming for all string properties.One way is on submitchanges,using reflection trim all string properties.Is there any other way?
thanks
Hi,
We are using linq-to-sql entities,and want to implement trimming for all string properties.One way is on submitchanges,using reflection trim all string properties.Is there any other way?
thanks
If you don't want to use reflection, you can implement the code generator to use generate the proper code with Trim() on all string procedures.
Another way is to get the context object and do the trimming on the submit part of the process.
I'm too sleepy now, as it's 1:45am here, to remember the proper code to do it. But it's possible, because I did something similar using Linq-to-Entities.
Edited to add
Take a look at my site. This code generator I made is for Linq-to-Entities but should be similar for Linq-to-SQL.