Following describes how it works
Create Edmx file i.e EntityFramwork file
Create connection with database
Select Table(s),view(s) and Stored procedure(s)
Created EDMX file
Use SqlFunction in query
Now after deisigning the enityframwork edmx file following is way to utilize the inbuilt sql server functions in Linq queries.
public List<person> SqlTest()
using (SchoolEntities se = new SchoolEntities())
var person = from p in se.People
where SqlFunctions.CharIndex("a", p.FirstName) == 1
As you see in above linq query its find out all persons whose name starts with letter "a". This is easily achievable by CharIndex function of sql server as you can see in query. This function is part of SqlFunction class avilable in .net framework.
SqlFunction class inside
#region Assembly System.Data.Entity.dll, v4.0.30319
// C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.Entity.dll
// Provides common language runtime (CLR) methods that call functions in the
// database in LINQ to Entities queries.
public static class SqlFunctions
........list of other function that is supported by this class
// Returns the starting position of one expression found within another expression.
// The string expression to be searched.
// The string expression to be found.
// The character position in toSearch where searching begins.
// The starting position of target if it is found in toSearch.
public static int? CharIndex(string toSearch, string target, int? startLocation)
As you can see SqlFuction is static class and contains static methods which calls sql server inbuilt function.
Get more information about SqlFunction class and its method on msdn at : SqlFunction