This page lists the Convert members that does _not_ work in Linq2SQL: http://msdn.microsoft.com/en-us/library/bb882655%28v=VS.100%29.aspx
It doesn't mention ToString(Int64), i.e. it seems Microsoft intended for that method to work. So my guess is that this should be, but isn't yet, implemented in Linq2NH also. /Oskar 2011/2/23 cremor <[email protected]>: > Thanks for the suggestion, but that doesn't work either. Just a little > different exception message: "System.String ToString(Int64)". > > On Feb 23, 1:33 pm, Oskar Berggren <[email protected]> wrote: >> Not an expert but I see "rumors" which suggests that >> Convert.ToString(x.yourProperty) might work for Linq to Sql. Don't >> know if it's implemented for NH. >> >> /Oskar >> >> 2011/2/23 cremor <[email protected]>: >> >> > Is it possible to use ToString() (or something similar) in Linq >> > queries? >> > I'd like to do something like this: >> >> > session.Query<Entity>().Where(x => >> > x.SomeInt64Property.ToString().Contains("123")).ToArray(); >> >> > But this throws a NotSupportedException with Message "System.String >> > ToString()". >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "nhusers" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group >> > athttp://groups.google.com/group/nhusers?hl=en. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
