LINQ Tip of the week: System.String support

Posted by: the telerik blogs, on 28 Aug 2009 | View original | Bookmarked: 0 time(s)

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.

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: XLinq | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1389 | Hits: 37

Similar Posts

  • Filtering with string parameter that allows free user input more
  • Open SQL Port for specific IP by ASP.NET Website more
  • Important Entity Framework Query Improvements for .NET 4.0 more
  • Silverlight Twitter Client with authentication more
  • Update to Logging in to DotNetNuke from a Silverlight Application with RIA Authentication more
  • SQL 2008 CLR Triggers, use a .NET class library in SQL using WPF more
  • WSE, DIME; WCF, MTOM; OH My! more
  • Silverlight 3 and WCF Faults more
  • A (less) simple include for ASP.NET more
  • Exposing Custom WCF Headers through WCF Behaviors more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD