Telerik blogs

Welcome back for some more information about the Telerik OpenAccess ORM support for LINQ.

Today we provide a brief list of the System.String properties and methods that are supported by our LINQ implementation. When any of the below listed methods are used in a LINQ query, Telerik OpenAccess ORM translates the method call to equivalent SQL which is then executed on the server.

Please note that the table lists the MS SqlServer specific SQL translation.

 

Properties

String.Length

len (string_expression)

 

Methods

String.CompareTo expression = expression
String.Contains match_expression LIKE pattern

String.EndsWith

match_expression LIKE pattern
String.Equals expression = expression
String.IndexOf(String) CHARINDEX (expression1,expression2, –1)
String.IndexOf(String,Int32) CHARINDEX (expression1,expression2, start_location)
String.Insert

CASE

  WHEN( LEN(ISNULL(column_name,'')) = start_index) THEN ISNULL(column_name,'') + value
  ELSE STUFF(ISNULL(column_name,''),1 + start_index, 0, value)

END

String.Remove(Int32) STUFF (character_expression, start, 8000, character_expression)
String.Remove(Int32, Int32) STUFF (character_expression, start, length, character_expression)
String.Replace(String,String) REPLACE (string_expression1, string_expression2, string_expression3)

String.StartsWith

match_expression LIKE pattern
String.Substring(Int32) SUBSTRING (expression, start, 8000)
String.Substring(Int32, Int32) SUBSTRING (expression, start, length)
String.ToLower() LOWER (character_expression)
String.ToUpper() UPPER (character_expression)
String.Trim() RTRIM (character_expression)

 

Static Methods

String.Compare expression = expression
String.CompareOrdinal expression = expression
String.Concat
expression = expression
String.IsNullOrEmpty
expression IS NULL OR 
expression = ‘’

 

We are in the process of continuously expanding our LINQ support and hence the above mentioned list will be updated periodically.


Comments

Comments are disabled in preview mode.